Skip to content

Commit

Permalink
Added shortcut for DOM-based custom ajax calls [closes vojtech-dobes#21]
Browse files Browse the repository at this point in the history
Enables syntax:
$('#element').click(function (e) {
    $(this).netteAjax(e, { ... })
    .done(function () { ... });
});
  • Loading branch information
vojtech-dobes committed Aug 23, 2012
1 parent c21cefa commit 5244045
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nette.ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ var nette = function () {

$.nette = new ($.extend(nette, $.nette ? $.nette : {}));

$.fn.netteAjax = function (e, options) {
return $.nette.ajax(options || {}, this[0], e);
};

$.nette.ext('validation', {
before: function (settings, ui, e) {
if (!settings.nette || !e) return true;
Expand Down

0 comments on commit 5244045

Please sign in to comment.