vendor/assets/javascripts/webshims/shims/combos/30.js in webshims-rails-1.10.11 vs vendor/assets/javascripts/webshims/shims/combos/30.js in webshims-rails-1.11.1
- old
+ new
@@ -11,14 +11,10 @@
if(!$.parseHTML){
webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
}
- if(webshims.cfg.extendNative === undefined){
- webshims.warn("extendNative configuration was set to false by default with this release. In case you rely on it set it to 'true' otherwise to 'false'. See http://bit.ly/16OOTQO");
- }
-
if (!webshims.cfg.no$Switch) {
var switch$ = function(){
if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
webshims.error("jQuery was included more than once. Make sure to include it only once or try the $.noConflict(extreme) feature! Webshims and other Plugins might not work properly. Or set webshims.cfg.no$Switch to 'true'.");
if (window.$) {
@@ -1295,65 +1291,15 @@
return message;
};
$(document).on('focusin.lazyloadvalidation', function(e){
- if('form' in e.target && $(e.target).is(':invalid')){
+ if('form' in e.target && (e.target.list || $(e.target).is(':invalid'))){
lazyLoad();
}
});
webshims.ready('WINDOWLOAD', lazyLoad);
- if(options.replaceValidationUI){
- webshims.ready('DOM forms', function(){
- $(document).on('firstinvalid', function(e){
- if(!e.isInvalidUIPrevented()){
- e.preventDefault();
- webshims.validityAlert.showFor( e.target );
- }
- });
- });
- }
-
- /* extension, but also used to fix native implementation workaround/bugfixes */
- (function(){
- var firstEvent,
- invalids = [],
- stopSubmitTimer,
- form
- ;
-
- $(document).on('invalid', function(e){
- if(e.wrongWebkitInvalid){return;}
- var jElm = $(e.target);
-
-
- if(!firstEvent){
- //trigger firstinvalid
- firstEvent = $.Event('firstinvalid');
- firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
- var firstSystemInvalid = $.Event('firstinvalidsystem');
- $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
- jElm.trigger(firstEvent);
- }
-
- //if firstinvalid was prevented all invalids will be also prevented
- if( firstEvent && firstEvent.isDefaultPrevented() ){
- e.preventDefault();
- }
- invalids.push(e.target);
- e.extraData = 'fix';
- clearTimeout(stopSubmitTimer);
- stopSubmitTimer = setTimeout(function(){
- var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
- //reset firstinvalid
- firstEvent = false;
- invalids = [];
- $(e.target).trigger(lastEvent, lastEvent);
- }, 9);
- jElm = null;
- });
- })();
});
webshims.register('form-message', function($, webshims, window, document, undefined, options){
"use strict";
if(options.lazyCustomMessages){
\ No newline at end of file