Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 33 additions & 17 deletions dist/verify.notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ $.notify.addStyle("bootstrap", {
window.console[fns[i]] = $.noop;

if(!$) return;

var I = function(i){ return i; };

function log() {
Expand Down Expand Up @@ -610,7 +610,7 @@ $.notify.addStyle("bootstrap", {

if($.console === undefined)
$.console = console;

$.consoleNoConflict = console;

}(jQuery));
Expand Down Expand Up @@ -735,57 +735,57 @@ var Class = null;
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;
// The base Class implementation (does nothing)
Class = function(){};

// Create a new Class that inherits from this class
Class.extend = function(prop) {
var _super = this.prototype;

// Instantiate a base class (but only create the instance,
// don't run the init constructor)
initializing = true;
var prototype = new this();
initializing = false;

// Copy the properties over onto the new prototype
for (var name in prop) {
// Check if we're overwriting an existing function
prototype[name] = typeof prop[name] == "function" &&
prototype[name] = typeof prop[name] == "function" &&
typeof _super[name] == "function" && fnTest.test(prop[name]) ?
(function(name, fn){
return function() {
var tmp = this._super;

// Add a new ._super() method that is the same method
// but on the super-class
this._super = _super[name];

// The method only need to be bound temporarily, so we
// remove it when we're done executing
var ret = fn.apply(this, arguments);
var ret = fn.apply(this, arguments);
this._super = tmp;

return ret;
};
})(name, prop[name]) :
prop[name];
}

// The dummy class constructor
function Class() {
// All construction is actually done in the init method
if ( !initializing && this.init )
this.init.apply(this, arguments);
}

// Populate our constructed prototype object
Class.prototype = prototype;

// Enforce the constructor to be what we expect
Class.prototype.constructor = Class;

// And make this class extendable
Class.extend = arguments.callee;

return Class;
};
})();
Expand Down Expand Up @@ -1031,9 +1031,11 @@ var globalOptions = {
if(!opts) opts = {color: 'red'};
$.notify(element, text, opts);
}
}
},
submitText: "Sending..."
};


//option object creator inheriting from globals
function CustomOptions(opts) {
$.extend(true, this, opts);
Expand Down Expand Up @@ -1655,11 +1657,25 @@ var ValidationForm = null;
this.submitResult === undefined) {

this.submitPending = true;

this.validate(this.doSubmit);

//have result
} else if (this.submitResult !== undefined) {
submitForm = this.options.beforeSubmit.call(this.domElem, event, this.submitResult);

if(this.submitResult == true)
{
//input submit
var idForm = this.domElem[0];
var inputSubmit = $(idForm).find(':submit');
var idInputSubmit = $(inputSubmit).attr('id');

// disable input submit for preventing double submit
$('#'+idInputSubmit).prop('disabled', true);
$('#'+idInputSubmit).val(globalOptions.submitText);

submitForm = this.options.beforeSubmit.call(this.domElem, event, this.submitResult);
}
}

if(!submitForm) event.preventDefault();
Expand Down Expand Up @@ -2564,4 +2580,4 @@ log("plugin added.");
});

})(jQuery);
}(window,document));
}(window,document));