From: Chris Oyler Date: Thu, 17 Dec 2015 01:00:03 +0000 (-0800) Subject: disables old abide from foundation global include X-Git-Tag: v6.1.0~4^2^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53a5b056ae152c7bf0f9092a54ec36cdebc2363b;p=thirdparty%2Ffoundation%2Ffoundation-sites.git disables old abide from foundation global include --- diff --git a/js/foundation.abide.js b/js/foundation.abide.js index cd82c0dd1..15b2f0580 100644 --- a/js/foundation.abide.js +++ b/js/foundation.abide.js @@ -11,13 +11,9 @@ function Abide(element, options) { this.$element = element; this.options = $.extend({}, Abide.defaults, this.$element.data(), options); - // this.$window = $(window); - // this.name = 'Abide'; - // this.attr = 'data-abide'; this._init(); - Foundation.registerPlugin(this); } @@ -65,11 +61,12 @@ validators: { equalTo: function (el, required, parent) { - var from = document.getElementById(el.getAttribute(this.add_namespace('data-equalto'))).value, - to = el.value, - valid = (from === to); - - return valid; + return $('#' + el.attr('data-equalto')).val() === el.val(); + // var from = document.getElementById(el.getAttribute('data-equalto')).value, + // to = el.value, + // valid = (from === to); + // + // return valid; } } }; @@ -88,6 +85,23 @@ * @private */ Abide.prototype._events = function() { + var _this = this; + + this.$element.off('.abide') + .on('reset.zf.abide reset.fndtn.abide', function(e){ + _this.resetForm($(this)); + }) + .on('submit.zf.abide submit.fndtn.abide', function(e){ + + }) + + + + + + + + var self = this; this.$element .off('.abide') @@ -100,7 +114,7 @@ .find('input, textarea, select') .off('.abide') .on('blur.fndtn.abide change.fndtn.abide', function (e) { - console.log(e); + if (self.options.validateOn === 'fieldChange') { self.validateInput($(e.target), self.$element); } @@ -408,7 +422,7 @@ //TODO this... }; - Foundation.plugin(Abide, 'Abide'); + // Foundation.plugin(Abide, 'Abide'); // Exports for AMD/Browserify if (typeof module !== 'undefined' && typeof module.exports !== 'undefined')