vendor/assets/javascripts/webshims/shims/combos/31.js in webshims-rails-1.10.9 vs vendor/assets/javascripts/webshims/shims/combos/31.js in webshims-rails-1.10.10

- old
+ new

@@ -10,18 +10,18 @@ if(!$.parseHTML){ webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims."); } - if(webshims.cfg.extendNative == 1){ + if(webshims.cfg.extendNative === 1){ webshims.warn("extendNative configuration will be set to false by default with next 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.."); + 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.$) { window.$ = webshims.$; } window.jQuery = webshims.$; } @@ -559,10 +559,11 @@ this.height = docObserve.getHeight(); this.width = docObserve.getWidth(); setInterval(this.test, 600); $(this.test); webshims.ready('WINDOWLOAD', this.test); + $(document).on('updatelayout', this.handler); $(window).bind('resize', this.handler); (function(){ var oldAnimate = $.fn.animate; var animationTimer; @@ -606,11 +607,13 @@ shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData); } $(nativeElem).on('remove', function(e){ if (!e.originalEvent) { - $(shadowElem).remove(); + setTimeout(function(){ + $(shadowElem).remove(); + }, 4); } }); nativeData.hasShadow = shadowElem; shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem; @@ -1084,11 +1087,11 @@ addRole(footer, 'contentinfo'); } } }); -})(jQuery, document); +})(webshims.$, document); webshims.register('form-core', function($, webshims, window, document, undefined, options){ "use strict"; webshims.capturingEventPrevented = function(e){ @@ -1163,10 +1166,11 @@ ['valid', 'invalid', 'required', 'optional'].forEach(function(name){ $.expr[":"][name] = $.expr.filters[name+"-element"]; }); + //bug was partially fixed in 1.10.0 for IE9, but not IE8 (move to es5 as soon as 1.10.2 is used) var pseudoFocus = $.expr[":"].focus; $.expr[":"].focus = function(){ try { return pseudoFocus.apply(this, arguments); } catch(e){ @@ -1185,14 +1189,22 @@ obj[fn].apply(obj, args); }); }; var transClass = ('transitionDelay' in document.documentElement.style) ? '' : ' no-transition'; + var poCFG = webshims.cfg.wspopover; + if(!poCFG.position && poCFG.position !== false){ + poCFG.position = { + at: 'left bottom', + my: 'left top', + collision: 'fit flip' + }; + } webshims.wsPopover = { id: 0, _create: function(){ - this.options = $.extend({}, webshims.cfg.wspopover, this.options); + this.options = $.extend(true, {}, poCFG, this.options); this.id = webshims.wsPopover.id++; this.eventns = '.wsoverlay' + this.id; this.timers = {}; this.element = $('<div class="ws-popover'+transClass+'" tabindex="-1"><div class="ws-po-outerbox"><div class="ws-po-arrow"><div class="ws-po-arrowbox" /></div><div class="ws-po-box" /></div></div>'); this.contentElement = $('.ws-po-box', this.element); @@ -1235,9 +1247,14 @@ webshims.getContentValidationMessage = function(elem, validity, key){ var message = $(elem).data('errormessage') || elem.getAttribute('x-moz-errormessage') || ''; if(key && message[key]){ message = message[key]; + } else if(message) { + validity = validity || $.prop(elem, 'validity') || {valid: 1}; + if(validity.valid){ + message = ''; + } } if(typeof message == 'object'){ validity = validity || $.prop(elem, 'validity') || {valid: 1}; if(!validity.valid){ $.each(validity, function(name, prop){ \ No newline at end of file