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

Listview class cleanup cleanup #8522

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/data.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI :data master
* jQuery UI :data 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/disable-selection.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/focusable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI Focusable master
* jQuery UI Focusable 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/form-reset-mixin.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/jquery-1-7.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/keycode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI Keycode master
* jQuery UI Keycode 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/labels.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI Labels master
* jQuery UI Labels 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/scroll-parent.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/tabbable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI Tabbable master
* jQuery UI Tabbable 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/unique-id.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion external/jquery-ui/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@

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

return $.ui.version = "master";
return $.ui.version = "1.12.1";

} ) );
70 changes: 45 additions & 25 deletions external/jquery-ui/widget.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI Widget master
* jQuery UI Widget 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -507,6 +514,10 @@ $.Widget.prototype = {
}
}

this._on( options.element, {
"remove": "_untrackClassesElement"
} );

if ( options.keys ) {
processClassString( options.keys.match( /\S+/g ) || [], true );
}
Expand All @@ -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 );
},
Expand Down
4 changes: 2 additions & 2 deletions external/jquery-ui/widgets/accordion.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI Accordion master
* jQuery UI Accordion 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down Expand Up @@ -37,7 +37,7 @@
}( function( $ ) {

return $.widget( "ui.accordion", {
version: "master",
version: "1.12.1",
options: {
active: 0,
animate: {},
Expand Down
4 changes: 2 additions & 2 deletions external/jquery-ui/widgets/button.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI Button master
* jQuery UI Button 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down Expand Up @@ -39,7 +39,7 @@
}( function( $ ) {

$.widget( "ui.button", {
version: "master",
version: "1.12.1",
defaultElement: "<button>",
options: {
classes: {
Expand Down
4 changes: 2 additions & 2 deletions external/jquery-ui/widgets/checkboxradio.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI Checkboxradio master
* jQuery UI Checkboxradio 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down Expand Up @@ -36,7 +36,7 @@
}( function( $ ) {

$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
version: "master",
version: "1.12.1",
options: {
disabled: null,
label: null,
Expand Down
6 changes: 3 additions & 3 deletions external/jquery-ui/widgets/controlgroup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI Controlgroup master
* jQuery UI Controlgroup 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions external/jquery-ui/widgets/datepicker.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -34,7 +34,7 @@
}
}( function( $ ) {

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

var datepicker_instActive;

Expand Down Expand Up @@ -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;

Expand Down
9 changes: 6 additions & 3 deletions external/jquery-ui/widgets/tabs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery UI Tabs master
* jQuery UI Tabs 1.12.1
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
Expand Down Expand Up @@ -37,7 +37,7 @@
}( function( $ ) {

$.widget( "ui.tabs", {
version: "master",
version: "1.12.1",
delay: 300,
options: {
active: null,
Expand Down Expand Up @@ -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 ) );
Expand Down
11 changes: 0 additions & 11 deletions js/widgets/listview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );

Expand Down