Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit d23270f

Browse files
author
Gabriel Schulhof
committed
Listview: Remove old item untracking and update jQuery UI to 1.12.1
Closes gh-8522
1 parent e377564 commit d23270f

20 files changed

+75
-63
lines changed

Diff for: bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"dependencies": {
1717
"jquery": ">=1.8.0",
18-
"jquery-ui": "jquery/jquery-ui#master"
18+
"jquery-ui": "jquery/jquery-ui#1.12.1"
1919
},
2020
"devDependencies": {
2121
"requirejs": "2.1.2",

Diff for: external/jquery-ui/data.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI :data master
2+
* jQuery UI :data 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

Diff for: external/jquery-ui/disable-selection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Disable Selection master
2+
* jQuery UI Disable Selection 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

Diff for: external/jquery-ui/focusable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Focusable master
2+
* jQuery UI Focusable 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

Diff for: external/jquery-ui/form-reset-mixin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Form Reset Mixin master
2+
* jQuery UI Form Reset Mixin 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

Diff for: external/jquery-ui/jquery-1-7.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Support for jQuery core 1.7.x master
2+
* jQuery UI Support for jQuery core 1.7.x 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

Diff for: external/jquery-ui/keycode.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Keycode master
2+
* jQuery UI Keycode 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

Diff for: external/jquery-ui/labels.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Labels master
2+
* jQuery UI Labels 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

Diff for: external/jquery-ui/scroll-parent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Scroll Parent master
2+
* jQuery UI Scroll Parent 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

Diff for: external/jquery-ui/tabbable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Tabbable master
2+
* jQuery UI Tabbable 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

Diff for: external/jquery-ui/unique-id.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Unique ID master
2+
* jQuery UI Unique ID 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

Diff for: external/jquery-ui/version.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
$.ui = $.ui || {};
1414

15-
return $.ui.version = "master";
15+
return $.ui.version = "1.12.1";
1616

1717
} ) );

Diff for: external/jquery-ui/widget.js

+45-25
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Widget master
2+
* jQuery UI Widget 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors
@@ -215,35 +215,42 @@ $.widget.bridge = function( name, object ) {
215215
var returnValue = this;
216216

217217
if ( isMethodCall ) {
218-
this.each( function() {
219-
var methodValue;
220-
var instance = $.data( this, fullName );
221218

222-
if ( options === "instance" ) {
223-
returnValue = instance;
224-
return false;
225-
}
219+
// If this is an empty collection, we need to have the instance method
220+
// return undefined instead of the jQuery instance
221+
if ( !this.length && options === "instance" ) {
222+
returnValue = undefined;
223+
} else {
224+
this.each( function() {
225+
var methodValue;
226+
var instance = $.data( this, fullName );
226227

227-
if ( !instance ) {
228-
return $.error( "cannot call methods on " + name +
229-
" prior to initialization; " +
230-
"attempted to call method '" + options + "'" );
231-
}
228+
if ( options === "instance" ) {
229+
returnValue = instance;
230+
return false;
231+
}
232232

233-
if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) {
234-
return $.error( "no such method '" + options + "' for " + name +
235-
" widget instance" );
236-
}
233+
if ( !instance ) {
234+
return $.error( "cannot call methods on " + name +
235+
" prior to initialization; " +
236+
"attempted to call method '" + options + "'" );
237+
}
237238

238-
methodValue = instance[ options ].apply( instance, args );
239+
if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) {
240+
return $.error( "no such method '" + options + "' for " + name +
241+
" widget instance" );
242+
}
239243

240-
if ( methodValue !== instance && methodValue !== undefined ) {
241-
returnValue = methodValue && methodValue.jquery ?
242-
returnValue.pushStack( methodValue.get() ) :
243-
methodValue;
244-
return false;
245-
}
246-
} );
244+
methodValue = instance[ options ].apply( instance, args );
245+
246+
if ( methodValue !== instance && methodValue !== undefined ) {
247+
returnValue = methodValue && methodValue.jquery ?
248+
returnValue.pushStack( methodValue.get() ) :
249+
methodValue;
250+
return false;
251+
}
252+
} );
253+
}
247254
} else {
248255

249256
// Allow multiple hashes to be passed on init
@@ -507,6 +514,10 @@ $.Widget.prototype = {
507514
}
508515
}
509516

517+
this._on( options.element, {
518+
"remove": "_untrackClassesElement"
519+
} );
520+
510521
if ( options.keys ) {
511522
processClassString( options.keys.match( /\S+/g ) || [], true );
512523
}
@@ -517,6 +528,15 @@ $.Widget.prototype = {
517528
return full.join( " " );
518529
},
519530

531+
_untrackClassesElement: function( event ) {
532+
var that = this;
533+
$.each( that.classesElementLookup, function( key, value ) {
534+
if ( $.inArray( event.target, value ) !== -1 ) {
535+
that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
536+
}
537+
} );
538+
},
539+
520540
_removeClass: function( element, keys, extra ) {
521541
return this._toggleClass( element, keys, extra, false );
522542
},

Diff for: external/jquery-ui/widgets/accordion.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Accordion master
2+
* jQuery UI Accordion 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors
@@ -37,7 +37,7 @@
3737
}( function( $ ) {
3838

3939
return $.widget( "ui.accordion", {
40-
version: "master",
40+
version: "1.12.1",
4141
options: {
4242
active: 0,
4343
animate: {},

Diff for: external/jquery-ui/widgets/button.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Button master
2+
* jQuery UI Button 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors
@@ -39,7 +39,7 @@
3939
}( function( $ ) {
4040

4141
$.widget( "ui.button", {
42-
version: "master",
42+
version: "1.12.1",
4343
defaultElement: "<button>",
4444
options: {
4545
classes: {

Diff for: external/jquery-ui/widgets/checkboxradio.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Checkboxradio master
2+
* jQuery UI Checkboxradio 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors
@@ -36,7 +36,7 @@
3636
}( function( $ ) {
3737

3838
$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
39-
version: "master",
39+
version: "1.12.1",
4040
options: {
4141
disabled: null,
4242
label: null,

Diff for: external/jquery-ui/widgets/controlgroup.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Controlgroup master
2+
* jQuery UI Controlgroup 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors
@@ -33,7 +33,7 @@
3333
var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
3434

3535
return $.widget( "ui.controlgroup", {
36-
version: "master",
36+
version: "1.12.1",
3737
defaultElement: "<div>",
3838
options: {
3939
direction: "horizontal",
@@ -234,7 +234,7 @@ return $.widget( "ui.controlgroup", {
234234
var result = {};
235235
$.each( classes, function( key ) {
236236
var current = instance.options.classes[ key ] || "";
237-
current = current.replace( controlgroupCornerRegex, "" ).trim();
237+
current = $.trim( current.replace( controlgroupCornerRegex, "" ) );
238238
result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
239239
} );
240240
return result;

Diff for: external/jquery-ui/widgets/datepicker.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// jscs:disable maximumLineLength
22
/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
33
/*!
4-
* jQuery UI Datepicker master
4+
* jQuery UI Datepicker 1.12.1
55
* http://jqueryui.com
66
*
77
* Copyright jQuery Foundation and other contributors
@@ -34,7 +34,7 @@
3434
}
3535
}( function( $ ) {
3636

37-
$.extend( $.ui, { datepicker: { version: "master" } } );
37+
$.extend( $.ui, { datepicker: { version: "1.12.1" } } );
3838

3939
var datepicker_instActive;
4040

@@ -2113,7 +2113,7 @@ $.fn.datepicker = function( options ) {
21132113
$.datepicker = new Datepicker(); // singleton instance
21142114
$.datepicker.initialized = false;
21152115
$.datepicker.uuid = new Date().getTime();
2116-
$.datepicker.version = "master";
2116+
$.datepicker.version = "1.12.1";
21172117

21182118
return $.datepicker;
21192119

Diff for: external/jquery-ui/widgets/tabs.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Tabs master
2+
* jQuery UI Tabs 1.12.1
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors
@@ -37,7 +37,7 @@
3737
}( function( $ ) {
3838

3939
$.widget( "ui.tabs", {
40-
version: "master",
40+
version: "1.12.1",
4141
delay: 300,
4242
options: {
4343
active: null,
@@ -889,7 +889,10 @@ $.widget( "ui.tabs", {
889889
_ajaxSettings: function( anchor, event, eventData ) {
890890
var that = this;
891891
return {
892-
url: anchor.attr( "href" ),
892+
893+
// Support: IE <11 only
894+
// Strip any hash that exists to prevent errors with the Ajax request
895+
url: anchor.attr( "href" ).replace( /#.*$/, "" ),
893896
beforeSend: function( jqXHR, settings ) {
894897
return that._trigger( "beforeLoad", event,
895898
$.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) );

Diff for: js/widgets/listview.js

-11
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,6 @@ return $.widget( "mobile.listview", $.extend( {
284284
// NOTE: Using the extension addFirstLastClasses is deprecated as of 1.5.0 and this and the
285285
// extension itself will be removed in 1.6.0.
286286
this._addFirstLastClasses( allItems, this._getVisibles( allItems, create ), create );
287-
288-
// Untrack removed items
289-
if ( this._oldListItems ) {
290-
this._removeClass(
291-
this._oldListItems.filter( function() {
292-
return ( $( this ).parent().length === 0 );
293-
} ),
294-
"ui-listview-item ui-listview-item-static ui-listview-item-has-count " +
295-
"ui-listview-item-has-alternate ui-listview-item-divider" );
296-
this._oldListItems = allItems;
297-
}
298287
}
299288
}, $.mobile.behaviors.addFirstLastClasses ) );
300289

0 commit comments

Comments
 (0)