Permalink
Browse files

Listview: Remove old item untracking and update jQuery UI to 1.12.1

Closes gh-8522
1 parent e377564 commit d23270fbefcd9c9af8b35ed309345cce3935baf9 @gabrielschulhof gabrielschulhof committed Sep 21, 2016
View
@@ -15,7 +15,7 @@
],
"dependencies": {
"jquery": ">=1.8.0",
- "jquery-ui": "jquery/jquery-ui#master"
+ "jquery-ui": "jquery/jquery-ui#1.12.1"
},
"devDependencies": {
"requirejs": "2.1.2",
@@ -1,5 +1,5 @@
/*!
- * jQuery UI :data master
+ * jQuery UI :data 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Disable Selection master
+ * jQuery UI Disable Selection 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Focusable master
+ * jQuery UI Focusable 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Form Reset Mixin master
+ * jQuery UI Form Reset Mixin 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Support for jQuery core 1.7.x master
+ * jQuery UI Support for jQuery core 1.7.x 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Keycode master
+ * jQuery UI Keycode 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Labels master
+ * jQuery UI Labels 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Scroll Parent master
+ * jQuery UI Scroll Parent 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Tabbable master
+ * jQuery UI Tabbable 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Unique ID master
+ * jQuery UI Unique ID 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -12,6 +12,6 @@
$.ui = $.ui || {};
-return $.ui.version = "master";
+return $.ui.version = "1.12.1";
} ) );
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Widget master
+ * jQuery UI Widget 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -215,35 +215,42 @@ $.widget.bridge = function( name, object ) {
var returnValue = this;
if ( isMethodCall ) {
- this.each( function() {
- var methodValue;
- var instance = $.data( this, fullName );
- if ( options === "instance" ) {
- returnValue = instance;
- return false;
- }
+ // If this is an empty collection, we need to have the instance method
+ // return undefined instead of the jQuery instance
+ if ( !this.length && options === "instance" ) {
+ returnValue = undefined;
+ } else {
+ this.each( function() {
+ var methodValue;
+ var instance = $.data( this, fullName );
- if ( !instance ) {
- return $.error( "cannot call methods on " + name +
- " prior to initialization; " +
- "attempted to call method '" + options + "'" );
- }
+ if ( options === "instance" ) {
+ returnValue = instance;
+ return false;
+ }
- if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) {
- return $.error( "no such method '" + options + "' for " + name +
- " widget instance" );
- }
+ if ( !instance ) {
+ return $.error( "cannot call methods on " + name +
+ " prior to initialization; " +
+ "attempted to call method '" + options + "'" );
+ }
- methodValue = instance[ options ].apply( instance, args );
+ if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) {
+ return $.error( "no such method '" + options + "' for " + name +
+ " widget instance" );
+ }
- if ( methodValue !== instance && methodValue !== undefined ) {
- returnValue = methodValue && methodValue.jquery ?
- returnValue.pushStack( methodValue.get() ) :
- methodValue;
- return false;
- }
- } );
+ methodValue = instance[ options ].apply( instance, args );
+
+ if ( methodValue !== instance && methodValue !== undefined ) {
+ returnValue = methodValue && methodValue.jquery ?
+ returnValue.pushStack( methodValue.get() ) :
+ methodValue;
+ return false;
+ }
+ } );
+ }
} else {
// Allow multiple hashes to be passed on init
@@ -507,6 +514,10 @@ $.Widget.prototype = {
}
}
+ this._on( options.element, {
+ "remove": "_untrackClassesElement"
+ } );
+
if ( options.keys ) {
processClassString( options.keys.match( /\S+/g ) || [], true );
}
@@ -517,6 +528,15 @@ $.Widget.prototype = {
return full.join( " " );
},
+ _untrackClassesElement: function( event ) {
+ var that = this;
+ $.each( that.classesElementLookup, function( key, value ) {
+ if ( $.inArray( event.target, value ) !== -1 ) {
+ that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
+ }
+ } );
+ },
+
_removeClass: function( element, keys, extra ) {
return this._toggleClass( element, keys, extra, false );
},
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Accordion master
+ * jQuery UI Accordion 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -37,7 +37,7 @@
}( function( $ ) {
return $.widget( "ui.accordion", {
- version: "master",
+ version: "1.12.1",
options: {
active: 0,
animate: {},
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Button master
+ * jQuery UI Button 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -39,7 +39,7 @@
}( function( $ ) {
$.widget( "ui.button", {
- version: "master",
+ version: "1.12.1",
defaultElement: "<button>",
options: {
classes: {
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Checkboxradio master
+ * jQuery UI Checkboxradio 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -36,7 +36,7 @@
}( function( $ ) {
$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
- version: "master",
+ version: "1.12.1",
options: {
disabled: null,
label: null,
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Controlgroup master
+ * jQuery UI Controlgroup 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -33,7 +33,7 @@
var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
return $.widget( "ui.controlgroup", {
- version: "master",
+ version: "1.12.1",
defaultElement: "<div>",
options: {
direction: "horizontal",
@@ -234,7 +234,7 @@ return $.widget( "ui.controlgroup", {
var result = {};
$.each( classes, function( key ) {
var current = instance.options.classes[ key ] || "";
- current = current.replace( controlgroupCornerRegex, "" ).trim();
+ current = $.trim( current.replace( controlgroupCornerRegex, "" ) );
result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
} );
return result;
@@ -1,7 +1,7 @@
// jscs:disable maximumLineLength
/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
/*!
- * jQuery UI Datepicker master
+ * jQuery UI Datepicker 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -34,7 +34,7 @@
}
}( function( $ ) {
-$.extend( $.ui, { datepicker: { version: "master" } } );
+$.extend( $.ui, { datepicker: { version: "1.12.1" } } );
var datepicker_instActive;
@@ -2113,7 +2113,7 @@ $.fn.datepicker = function( options ) {
$.datepicker = new Datepicker(); // singleton instance
$.datepicker.initialized = false;
$.datepicker.uuid = new Date().getTime();
-$.datepicker.version = "master";
+$.datepicker.version = "1.12.1";
return $.datepicker;
@@ -1,5 +1,5 @@
/*!
- * jQuery UI Tabs master
+ * jQuery UI Tabs 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
@@ -37,7 +37,7 @@
}( function( $ ) {
$.widget( "ui.tabs", {
- version: "master",
+ version: "1.12.1",
delay: 300,
options: {
active: null,
@@ -889,7 +889,10 @@ $.widget( "ui.tabs", {
_ajaxSettings: function( anchor, event, eventData ) {
var that = this;
return {
- url: anchor.attr( "href" ),
+
+ // Support: IE <11 only
+ // Strip any hash that exists to prevent errors with the Ajax request
+ url: anchor.attr( "href" ).replace( /#.*$/, "" ),
beforeSend: function( jqXHR, settings ) {
return that._trigger( "beforeLoad", event,
$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );
@@ -284,17 +284,6 @@ return $.widget( "mobile.listview", $.extend( {
// NOTE: Using the extension addFirstLastClasses is deprecated as of 1.5.0 and this and the
// extension itself will be removed in 1.6.0.
this._addFirstLastClasses( allItems, this._getVisibles( allItems, create ), create );
-
- // Untrack removed items
- if ( this._oldListItems ) {
- this._removeClass(
- this._oldListItems.filter( function() {
- return ( $( this ).parent().length === 0 );
- } ),
- "ui-listview-item ui-listview-item-static ui-listview-item-has-count " +
- "ui-listview-item-has-alternate ui-listview-item-divider" );
- this._oldListItems = allItems;
- }
}
}, $.mobile.behaviors.addFirstLastClasses ) );

0 comments on commit d23270f

Please sign in to comment.