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

Commit a9fa2a3

Browse files
author
Scott Jehl
committed
exposed refresh as a public method of the columntoggle table
1 parent f04dbd6 commit a9fa2a3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

js/widgets/jquery.mobile.table.columntoggle.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ $( document ).delegate( ":jqmData(role='table')", "tablecreate", function() {
6262
theme: o.columnPopupTheme
6363
});
6464
}
65+
6566
});
6667

6768
$menuButton
@@ -85,18 +86,20 @@ $( document ).delegate( ":jqmData(role='table')", "tablecreate", function() {
8586
} );
8687

8788

88-
function refreshMenu(){
89+
90+
// refresh method
91+
self.refresh = function(){
8992
$menu.find( "input" ).each( function(){
9093
this.checked = $( this ).jqmData( "cells" ).eq(0).is( ":visible" );
9194
$( this ).checkboxradio( "refresh" );
9295
} );
93-
}
96+
};
9497

95-
$( window ).on( "throttledresize", refreshMenu );
98+
$( window ).on( "throttledresize", self.refresh );
9699

97100
// TODO. Why is a stack unwind needed here?
98101
// Maybe because we're waiting on CSS to be applied before that :visible check above can work
99-
setTimeout( refreshMenu, 0 );
102+
setTimeout( self.refresh, 0 );
100103

101104
});
102105

0 commit comments

Comments
 (0)