vendor/assets/javascripts/webshims/shims/combos/31.js in webshims-rails-1.14.4 vs vendor/assets/javascripts/webshims/shims/combos/31.js in webshims-rails-1.14.5
- old
+ new
@@ -547,12 +547,13 @@
var data = elementData(elem, 'implemented') || elementData(elem, 'implemented', {});
if(data[type]){
webshims.warn(type +' already implemented for element #'+elem.id);
return false;
}
+
data[type] = true;
- return true;
+ return !$(elem).hasClass('ws-nopolyfill');
},
extendUNDEFProp: function(obj, props){
$.each(props, function(name, prop){
if( !(name in obj) ){
obj[name] = prop;
@@ -1237,10 +1238,13 @@
var isValid = function(elem){
return ($.prop(elem, 'validity') || {valid: 1}).valid;
};
var lazyLoad = function(){
var toLoad = ['form-validation'];
+
+ $(document).off('.lazyloadvalidation');
+
if(options.lazyCustomMessages){
options.customMessages = true;
toLoad.push('form-message');
}
@@ -1251,11 +1255,10 @@
if(options.addValidators){
toLoad.push('form-validators');
}
webshims.reTest(toLoad);
- $(document).off('.lazyloadvalidation');
};
/*
* Selectors for all browsers
*/
@@ -1308,15 +1311,15 @@
}
return matches.apply(this, arguments);
};
$.extend(exp, {
"enabled": function( elem ) {
- return elem.disabled === false && !$(elem).is('fieldset[disabled] *');
+ return 'disabled' in elem && elem.disabled === false && !$.find.matchesSelector(elem, 'fieldset[disabled] *');
},
"disabled": function( elem ) {
- return elem.disabled === true || ('disabled' in elem && $(elem).is('fieldset[disabled] *'));
+ return elem.disabled === true || ('disabled' in elem && $.find.matchesSelector(elem, 'fieldset[disabled] *'));
}
});
}
@@ -1491,12 +1494,11 @@
}
}
};
-
- $(document).on('focusin.lazyloadvalidation', function(e){
+ $(document).on('focusin.lazyloadvalidation mousedown.lazyloadvalidation touchstart.lazyloadvalidation', function(e){
if('form' in e.target){
lazyLoad();
}
});
@@ -1523,9 +1525,17 @@
}
}
});
}
});
+
+ if(options.addValidators && options.fastValidators){
+ webshims.reTest(['form-validators', 'form-validation']);
+ }
+
+ if(document.readyState == 'complete'){
+ webshims.isReady('WINDOWLOAD', true);
+ }
});
;webshims.register('form-datalist', function($, webshims, window, document, undefined, options){
"use strict";
var lazyLoad = function(name){
if(!name || typeof name != 'string'){