Ver código fonte

Allow context to be used as template. Maintain chainability.

tags/0.5.1
Phui Hock Michael Jackson 14 anos atrás
pai
commit
bfcc05a93f
1 arquivos alterados com 9 adições e 1 exclusões
  1. +9
    -1
      wrappers/jquery/jquery.mustache.js.tpl.post

+ 9
- 1
wrappers/jquery/jquery.mustache.js.tpl.post Ver arquivo

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

$.mustache = function(template, view, partials) {
$.mustache = function (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);

Carregando…
Cancelar
Salvar