Showing with 15 additions and 12 deletions.
  1. +3 −3 js/widgets/forms/checkboxradio.js
  2. +0 −8 js/widgets/table.columntoggle.js
  3. +12 −1 tests/unit/table/table_core.js
@@ -135,7 +135,7 @@ $.widget( "mobile.checkboxradio", $.extend( {
// Adds checked attribute to checked input when keyboard is used
this.element.prop( "checked", this.element.is( ":checked" ) );
this._getInputSet().not( this.element ).prop( "checked", false );
this._updateAll();
this._updateAll( true );
},

_handleLabelVMouseOver: function( event ) {
@@ -225,13 +225,13 @@ $.widget( "mobile.checkboxradio", $.extend( {
return radios;
},

_updateAll: function() {
_updateAll: function( changeTriggered ) {
var self = this;

this._getInputSet().each( function() {
var $this = $( this );

if ( this.checked || self.inputtype === "checkbox" ) {
if ( ( this.checked || self.inputtype === "checkbox" ) && !changeTriggered ) {
$this.trigger( "change" );
}
})
@@ -126,14 +126,6 @@ $.widget( "mobile.table", $.mobile.table, {
input.jqmData( "cells" )
.toggleClass( "ui-table-cell-hidden", !checked )
.toggleClass( "ui-table-cell-visible", checked );

if ( input[ 0 ].getAttribute( "locked" ) ) {
input.removeAttr( "locked" );

this._unlockCells( input.jqmData( "cells" ) );
} else {
input.attr( "locked", true );
}
},

_unlockCells: function( cells ) {
@@ -174,7 +174,7 @@
});

asyncTest( "Toggle column", function() {
expect( 6 );
expect( 9 );

var initial, post,
input = $( "#toggle-column-test-popup input:nth(1)" ),
@@ -224,6 +224,17 @@
post = checkColumn( "After clicking: " );
deepEqual( initial !== post, true,
"Visibility was toggled by clicking the checkbox" );
input.prop( "checked", false ).checkboxradio( "refresh" ).trigger( "change" );
post = initial;
},
{
change: { src: input, event: "change.toggleColumn2" }
},
function() {
post = checkColumn( "After unchecking checkbox via its 'checked' property" );
deepEqual( initial === post, true,
"Unchecking already unchecked checkbox via its 'checked' property does " +
"not affect column visibility" );
start();
}
]);