Skip to content

Commit ffac733

Browse files
committed
Fixed issue with nestedTemplateFormatter
fixed nestedTemplateFormatter to work with a just a string as the template selector for the options, rather than requiring a JSON object
1 parent 6e65746 commit ffac733

File tree

6 files changed

+9
-4
lines changed

6 files changed

+9
-4
lines changed

Examples/SimpleExample/example.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ <h2>Example of loading a template from a script tag within the same document.</h
3232
<div data-content="testSingle"></div>
3333
<div data-template-bind='{"attribute": "content", "value": "testArray", "formatter": "nestedTemplateFormatter", "formatOptions": {"parentElement": "ul", "template": "#templateThis"}}'></div>
3434
<div data-content="testArray" data-format="nestedTemplateFormatter" data-format-options='{"parentElement": "ul", "template": "#templateThis"}'></div>
35+
<div data-content="testArray" data-format="nestedTemplateFormatter" data-format-options='#templateThis'></div>
3536
</script>
3637

3738
<script type="text/javascript">

Examples/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ <h3>Code</h3>
4848
</div>
4949
<script>
5050
$(function () {
51+
$.ajaxSetup ({
52+
// Disable caching of AJAX responses
53+
cache: false
54+
});
5155
function getInternetExplorerVersion()
5256
// Returns the version of Internet Explorer or a -1
5357
// (indicating the use of another browser).

jquery-loadTemplate/jquery.loadTemplate-1.3.1.js renamed to jquery-loadTemplate/jquery.loadTemplate-1.3.2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@
427427
return;
428428
}
429429

430-
if (typeof options === "string") {
430+
if (typeof options === "string" && options[0] === "{") {
431431
options = $.parseJSON(options);
432432
}
433433

jquery-loadTemplate/jquery.loadTemplate-1.3.1.min.js renamed to jquery-loadTemplate/jquery.loadTemplate-1.3.2.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

loadTemplate.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"templates",
77
"templating"
88
],
9-
"version": "1.3.1",
9+
"version": "1.3.2",
1010
"author": {
1111
"name": "Paul Burgess and other contributors",
1212
"url": "https://github.com/codepb/jquery-template"

tests/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<title>loadTemplate Test Suite</title>
55
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
6-
<script src="../jquery-loadTemplate/jquery.loadTemplate-1.3.1.js" type="text/javascript"></script>
6+
<script src="../jquery-loadTemplate/jquery.loadTemplate-1.3.2.js" type="text/javascript"></script>
77
<script src="testRunner.js" type="text/javascript"></script>
88

99
<!--TEST SCRIPTS-->

0 commit comments

Comments
 (0)