vendor/assets/javascripts/webshims/shims/combos/15.js in webshims-rails-1.15.3 vs vendor/assets/javascripts/webshims/shims/combos/15.js in webshims-rails-1.15.4
- old
+ new
@@ -100,24 +100,29 @@
var singleVal = function(elem, name, val, pass, _argless){
return (_argless) ? oldVal.call($(elem)) : oldVal.call($(elem), val);
};
//jquery mobile and jquery ui
- if(!$.widget){
+ if(!$.widget && (!$.pluginFactory || !$.pluginFactory.mixin)){
(function(){
var _cleanData = $.cleanData;
- $.cleanData = function( elems ) {
- if(!$.widget){
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+ $.cleanData = (function( orig ) {
+ return function( elems ) {
+ var events, elem, i;
+ for ( i = 0; (elem = elems[i]) != null; i++ ) {
try {
- $( elem ).triggerHandler( "remove" );
- // http://bugs.jquery.com/ticket/8235
- } catch( e ) {}
+ // Only trigger remove when necessary to save time
+ events = $._data( elem, "events" );
+ if ( events && events.remove ) {
+ $( elem ).triggerHandler( "remove" );
+ }
+ // http://bugs.jquery.com/ticket/8235
+ } catch ( e ) {}
}
- }
- _cleanData( elems );
- };
+ orig( elems );
+ };
+ })( $.cleanData );
})();
}
$.fn.val = function(val){
@@ -534,11 +539,11 @@
elem.eq(0).prop('id', id);
}
return id;
};
})(),
- domPrefixes: ["ws", "webkit", "moz", "ms", "o"],
+ domPrefixes: ["webkit", "moz", "ms", "o", "ws"],
prefixed: function (prop, obj){
var i, testProp;
var ret = false;
if(obj[prop]){
@@ -1485,10 +1490,12 @@
if(webshims.replaceValidationplaceholder){
message = webshims.replaceValidationplaceholder(elem, message);
}
return message || '';
};
+
+ webshims.refreshCustomValidityRules = $.noop;
$.fn.getErrorMessage = function(key){
var message = '';
var elem = this[0];
if(elem){
@@ -2147,25 +2154,28 @@
})();
}
webshims.addReady(function(context, contextElem){
//start constrain-validation
- var focusElem;
+
$('form', context)
.add(contextElem.filter('form'))
.on('invalid', $.noop)
;
-
- try {
- if(context == document && !('form' in (document.activeElement || {}))) {
- focusElem = $(context.querySelector('input[autofocus], select[autofocus], textarea[autofocus]')).eq(0).getShadowFocusElement()[0];
- if (focusElem && focusElem.offsetHeight && focusElem.offsetWidth) {
- focusElem.focus();
+
+ setTimeout(function(){
+ var focusElem;
+ try {
+ if(!('form' in (document.activeElement || {}))) {
+ focusElem = $(context.querySelector('input[autofocus], select[autofocus], textarea[autofocus]')).eq(0).getShadowFocusElement()[0];
+ if (focusElem && (focusElem.offsetHeight || focusElem.offsetWidth)) {
+ focusElem.focus();
+ }
}
}
- }
- catch (er) {}
-
+ catch (er) {}
+ }, 9);
+
});
if(!webshims.support.datalist){
webshims.defineNodeNameProperty('datalist', 'options', {
prop: {