Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dist/jquery.loadTemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,10 @@
$elem.attr("id", applyFormatters($elem, value, "id", settings));
});



processElements("data-css", template, data, settings, function ($elem, value) {
$elem.css(applyFormatters($elem, value, "css", settings))
});

processElements("data-class", template, data, settings, function ($elem, value) {
$elem.addClass(applyFormatters($elem, value, "class", settings));
});
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.loadTemplate.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ There are a number of different bindings and ways to bind the data. The followin
- "data-alt" - sets the alt value of the element to the value provided (uses $(elem).attr("alt", value));
- "data-value" - sets the value attribute of the element to the value provided (uses $(elem).val(value))
- "data-class" - sets the class attribute of the element to the value provided (uses $(elem).class(value))
- "data-css" - sets the CSS attribute of the element to the value provided (uses $(elem).css(value))
- "data-link" - sets the innerHtml of the element to be a link to the value provided (wraps the content in an <a> tag).
- "data-link-wrap" - wraps the element in a link to the value provided. Same as "data-link", but the <a> tag wraps the element as well as the content.
- "data-options" - adds options to a select box. The value for this should reference an array of strings, each option will be output as a separate option. The value will be the same as the displayed text for each option. For a more powerful version of this look at the data-template-bind option.
Expand Down