Created
November 23, 2014 03:46
-
-
Save lookyman/e8b1666f648a351e1c0e to your computer and use it in GitHub Desktop.
jQuery Toggles https://github.com/simontabor/jquery-toggles/ with nette.ajax.js https://github.com/vojtech-dobes/nette.ajax.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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