Skip to content

Instantly share code, notes, and snippets.

@lookyman
Created November 23, 2014 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lookyman/e8b1666f648a351e1c0e to your computer and use it in GitHub Desktop.
Save lookyman/e8b1666f648a351e1c0e to your computer and use it in GitHub Desktop.
(function($, undefined) {
$.nette.ext(
'toggles',
{
init: function() {
this.initToggles();
var snippets;
if (snippets = this.ext('snippets', true)) {
snippets.complete($.proxy(function() {
this.initToggles();
}, this));
}
}
},
{
initToggles: function() {
$('.toggle').toggles().on('toggle', function() {
$.nette.ajax({url: $(this).data('href')});
});
}
}
);
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment