vendor/assets/javascripts/webshims/shims/dom-extend.js in webshims-rails-1.15.3 vs vendor/assets/javascripts/webshims/shims/dom-extend.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,10 +539,10 @@
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]){