Sfoglia il codice sorgente

Allow context to be used as template. Maintain chainability.

tags/0.5.1
Phui Hock Michael Jackson 14 anni fa
parent
commit
bfcc05a93f
1 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. +9
    -1
      wrappers/jquery/jquery.mustache.js.tpl.post

+ 9
- 1
wrappers/jquery/jquery.mustache.js.tpl.post Vedi File

@@ -1,6 +1,14 @@


$.mustache = function(template, view, partials) {
$.mustache = function (template, view, partials) {
return Mustache.render(template, view, partials); return Mustache.render(template, view, partials);
}; };


$.fn.mustache = function (view, partials) {
return $(this).map(function (i, elm) {
var template = $(elm).html().trim();
var output = $.mustache(template, view, partials);
return $(output).get();
});
};

})(jQuery); })(jQuery);

Loading…
Annulla
Salva