Committer: dpetrov
LJSUP-11969: Add an api to insert translated template into pageU trunk/htdocs/js/jquery/jquery.lj.basicWidget.js
Modified: trunk/htdocs/js/jquery/jquery.lj.basicWidget.js =================================================================== --- trunk/htdocs/js/jquery/jquery.lj.basicWidget.js 2012-04-27 12:28:48 UTC (rev 11848) +++ trunk/htdocs/js/jquery/jquery.lj.basicWidget.js 2012-04-27 12:31:55 UTC (rev 11849) @@ -208,6 +208,18 @@ */ _s: function(name) { return this.options.selectors[name]; + }, + + /** + * Apply template specified by name with data. + * + * @param {string} name The key name of the template in this.options.templates. + * @param {Object} data The data object which should be applied to the template. + * + * @return {jQuery} jQuery object with generated markup. + */ + _tmpl: function(name, data) { + return LJ.UI.template(this.options.templates[name], data); } } ); } )( jQuery );