Permalink
Browse files

Table: Do not update columns that have no priority set

  • Loading branch information...
gabrielschulhof authored and arschmitz committed Jun 4, 2014
1 parent 49f36fc commit 25debe11d5ae034d45a8e893b2d8c8a6443ae165
Showing with 14 additions and 13 deletions.
  1. +12 −11 js/widgets/table.columntoggle.js
  2. +2 −2 js/widgets/table.columntoggle.popup.js
@@ -56,21 +56,22 @@ return $.widget( "mobile.table", $.mobile.table, {
this._updateHeaderPriorities();
},
_updateSingleHeaderPriority: function( header, cells, priority/*, state */ ) {
if ( priority ) {
cells.addClass( this.options.classes.priorityPrefix + priority );
}
_updateVariableColumn: function( header, cells, priority/*, state */ ) {
cells.addClass( this.options.classes.priorityPrefix + priority );
},
_updateHeaderPriorities: function( state ) {
this.headers.each( $.proxy( function( index, element ) {
var header = $( element );
this._updateSingleHeaderPriority(
header,
header.add( header.jqmData( "cells" ) ),
$.mobile.getAttribute( element, "priority" ),
state );
var header = $( element ),
priority = $.mobile.getAttribute( element, "priority" );
if ( priority ) {
this._updateVariableColumn(
header,
header.add( header.jqmData( "cells" ) ),
priority,
state );
}
}, this ) );
},
@@ -47,10 +47,10 @@ $.widget( "mobile.table", $.mobile.table, {
}
},
_updateSingleHeaderPriority: function( header, cells, priority, state ) {
_updateVariableColumn: function( header, cells, priority, state ) {
var input;
if ( priority && ( this.options.columnUi || ( state && state.turningOnUI ) ) ) {
if ( this.options.columnUi || ( state && state.turningOnUI ) ) {
// Make sure the (new?) checkbox is associated with its header via .jqmData() and that,
// vice versa, the header is also associated with the checkbox

0 comments on commit 25debe1

Please sign in to comment.