]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
updates to remove conflicts
authorChris Oyler <chris@zurb.com>
Tue, 15 Dec 2015 19:04:04 +0000 (11:04 -0800)
committerChris Oyler <chris@zurb.com>
Tue, 15 Dec 2015 19:04:04 +0000 (11:04 -0800)
;

1  2 
js/foundation.abide.js

index 38dac44ae9a953931f43bc2dd5a8f5f1f86d243b,b7f9b22dd3f9dde48d83658fdc1e07818e73770e..cd82c0dd140d732e9968a857f710744792f7c744
    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.$window  = $(window);
++    // this.name     = 'Abide';
++    // this.attr     = 'data-abide';
  
      this._init();
--    this._events();
++
  
      Foundation.registerPlugin(this);
    }
@@@ -30,6 -30,6 +30,7 @@@
      inputErrorClass: 'is-invalid-input',
      formErrorSelector: '.form-error',
      formErrorClass: 'is-visible',
++
      patterns: {
        alpha : /^[a-zA-Z]+$/,
        alpha_numeric : /^[a-zA-Z0-9]+$/,
        // #FFF or #FFFFFF
        color : /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/
      },
++
      validators: {
 -      equalTo: function ($el, required, parent) {
 -        var from = $('#'+$el.attr('data-equalto')).val(),
 -            to    = $el.val(),
 +      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;
@@@ -77,7 -77,7 +79,8 @@@
     * Initializes the Abide plugin and calls functions to get Abide functioning on load.
     * @private
     */
--  Abide.prototype._init = function() {
++  Abide.prototype._init = function(){
++    this._events();
    };
  
    /**
     * @param {Object} element - jQuery object to check for required attribute
     * @returns {Boolean} Boolean value depends on whether or not attribute is checked or empty
     */
 +   var counter = 0;
    Abide.prototype.requiredCheck = function($el) {
      switch ($el[0].type) {
++
        case 'text':
 +      case 'password':
          if ($el.attr('required') && !$el.val()) {
            // requirement check does not pass
            return false;
            return true;
          }
          break;
++
        case 'checkbox':
-         // if ($el.attr('required') && !$el.is(':checked')) {
-         //   return false;
-         // } else {
-         //   return true;
-         // }
-         // break;
 -        if ($el.attr('required') && !$el.is(':checked')) {
 -          return false;
 -        } else {
 -          return true;
 -        }
 -        break;
        case 'radio':
 +      console.log($el[0].type, counter++);
          if ($el.attr('required') && !$el.is(':checked')) {
            return false;
          } else {
            return true;
          }
          break;
++
        default:
          if ($el.attr('required') && (!$el.val() || !$el.val().length)) {
            return false;