]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
disables old abide from foundation global include
authorChris Oyler <chris@zurb.com>
Thu, 17 Dec 2015 01:00:03 +0000 (17:00 -0800)
committerChris Oyler <chris@zurb.com>
Thu, 17 Dec 2015 01:00:03 +0000 (17:00 -0800)
js/foundation.abide.js

index cd82c0dd140d732e9968a857f710744792f7c744..15b2f0580054b2c26c821f61fd297591fe45ab65 100644 (file)
   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);
   }
 
 
     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;
       }
     }
   };
    * @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')
       .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);
           }
     //TODO this...
   };
 
-  Foundation.plugin(Abide, 'Abide');
+  // Foundation.plugin(Abide, 'Abide');
 
   // Exports for AMD/Browserify
   if (typeof module !== 'undefined' && typeof module.exports !== 'undefined')