Commit b3cab7ac authored by Sven Franck's avatar Sven Franck

add responsive classes without generating JQM table popup

parent 497c6db7
......@@ -495,6 +495,9 @@ $.widget( "mobile.table", $.mobile.table, {
this._setToggleState();
} else {
this._setTableClasses();
// add responsive CSS
this._addResponsiveClassAndLabel();
}
if (o.sort) {
this._setSorting();
......@@ -530,33 +533,38 @@ $.widget( "mobile.table", $.mobile.table, {
});
},
_addToggles: function( menu, keep ) {
var opts = this.options;
// allow update of menu on refresh (fixes #5880)
if ( !keep ) {
menu.empty();
}
_addResponsiveClassAndLabel: function ( keep ) {
var o = this.options;
// create the hide/show toggles
this.headers.not( "td" ).each( function() {
var header = $( this ),
priority = $.mobile.getAttribute( this, "priority", true ),
cells = header.add( header.jqmData( "cells" ) );
if( priority ) {
cells.addClass( opts.classes.priorityPrefix + priority );
cells.addClass( o.classes.priorityPrefix + priority );
if ( !keep ) {
$("<label><input type='checkbox' checked />" + header.text() + "</label>" )
.appendTo( menu )
.children( 0 )
.jqmData( "cells", cells )
.checkboxradio( {
theme: opts.columnPopupTheme
theme: o.columnPopupTheme
});
}
}
});
},
_addToggles: function( menu, keep ) {
var opts = this.options;
// allow update of menu on refresh (fixes #5880)
if ( !keep ) {
menu.empty();
}
this._addResponsiveClassAndLabel(keep);
// set bindings here
if ( !keep ) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment