Skip to content

Commit

Permalink
(examples) UIComponents: fix for creating MoreMenu widget
Browse files Browse the repository at this point in the history
[Issue] #1547
[Problem] DropDownMenu / More menu causes js issue
[Solution]
 - fix for app, DropDown Menu widget was creating
  on not existing DOM element.

Signed-off-by: Tomasz Lukawski <t.lukawski@samsung.com>
  • Loading branch information
TomaszLukawskiSam committed Jan 6, 2021
1 parent 8b406f9 commit 37045d7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
</div>
<div class="ui-appbar-action-buttons-container">
<button class="ui-btn ui-btn-icon ui-btn-icon-more" data-style="flat"></button>
<select class="theme-changer" data-native-menu="false" style="display: none">
<option value="light">
Light Theme
</option>
<option value="dark" class="ui-dropdown-two-lines">
Dark Theme
</option>
</select>
</div>
</header>
<div class="ui-content">
Expand Down Expand Up @@ -55,7 +63,7 @@
Option2
</option>
<option value="3">
Very, Very, Very long option 3
Very, Very, Very long option 3
</option>
<option value="4">
Option4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@
</div>
<div class="ui-appbar-action-buttons-container">
<button class="ui-btn ui-btn-icon ui-btn-icon-more" data-style="flat"></button>
<select class="theme-changer" data-native-menu="false" style="display: none">
<option value="light">
Light Theme
</option>
<option value="dark" class="ui-dropdown-two-lines">
Dark Theme
</option>
</select>
</div>
</header>
<div class="ui-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@
</div>
<div class="ui-appbar-action-buttons-container">
<button class="ui-btn ui-btn-icon ui-btn-icon-more" data-style="flat"></button>
<select class="theme-changer" data-native-menu="false" style="display: none">
<option value="light">
Light Theme
</option>
<option value="dark" class="ui-dropdown-two-lines">
Dark Theme
</option>
</select>
</div>
</header>
<div class="ui-content">
Expand Down
8 changes: 6 additions & 2 deletions examples/mobile/UIComponents/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@
tau.theme.setTheme(event.target.value);
}


function onMenuClick() {
var dropDownMenuWidget = tau.widget.DropdownMenu(themeChanger);
var dropDownMenuWidget;

dropDownMenuWidget.open();
if (themeChanger) {
dropDownMenuWidget = tau.widget.DropdownMenu(themeChanger);
dropDownMenuWidget.open();
}
}

function onPageShow() {
Expand Down

0 comments on commit 37045d7

Please sign in to comment.