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

Commit 4875301

Browse files
apsdehalarschmitz
authored andcommitted
Table: Fix columntoggle test button theme setting
1 parent fb6337f commit 4875301

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

js/widgets/table.columntoggle.popup.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ return $.widget( "mobile.table", $.mobile.table, {
4848
_create: function() {
4949
var id, popup;
5050

51+
this.options.columnButtonTheme =
52+
this.options.columnButtonTheme ? this.options.columnButtonTheme : "inherit";
53+
5154
this._super();
5255

56+
5357
if ( this.options.mode !== "columntoggle" || !this.options.columnUi ) {
5458
return;
5559
}
@@ -270,14 +274,13 @@ return $.widget( "mobile.table", $.mobile.table, {
270274
_columnsButton: function() {
271275
var id = this._id(),
272276
options = this.options,
273-
buttonTheme = this._themeClassFromOption( "ui-button-", options.columnButtonTheme ),
274277
button = $( "<a href='#" + id + "-popup' " +
275278
"id='" + id + "-button' " +
276-
"data-" + $.mobile.ns + "rel='popup'>" + options.columnButtonText + "</a>" );
279+
"data-" + $.mobile.ns + "rel='popup' data-theme='" +
280+
options.columnButtonTheme + "'>" + options.columnButtonText + "</a>" );
277281

278282
button.button();
279-
this._addClass( button, "ui-table-columntoggle-btn" +
280-
( buttonTheme ? " " + buttonTheme : "" ) );
283+
this._addClass( button, "ui-table-columntoggle-btn" );
281284

282285
this._on( button, {
283286
click: "_handleButtonClicked"

tests/integration/table/columntoggle_option_core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ QUnit.test( "Default columnButtonTheme", function( assert ) {
4747
testClasses( assert,
4848
$( "#columntoggle-option-test-blank" ),
4949
$( "#columntoggle-option-test-blank-button" )[ 0 ],
50-
"ui-button-", "", "columnButtonTheme", "b", "ui-button-b" );
50+
"ui-button-", "ui-button-inherit", "columnButtonTheme", "b", "ui-button-b" );
5151
} );
5252

5353
QUnit.test( "Explicit columnButtonTheme", function( assert ) {

0 commit comments

Comments
 (0)