-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2694 from infor-design/2691-searchfield-toolbar
2691 - Change Toolbar API's Teardown to respect `noSearchfieldReinvoke` setting
- Loading branch information
Showing
3 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
app/views/components/toolbar/test-searchfield-no-reinvoke-update.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<div class="row top-padding"> | ||
<div class="twelve columns"> | ||
|
||
<div id="regular-toolbar-example" class="toolbar" role="toolbar" data-options="{'noSearchfieldReinvoke': 'true'}"> | ||
<div class="title"> | ||
Toolbar Title | ||
</div> | ||
<div class="buttonset"> | ||
<div class="searchfield-wrapper toolbar-searchfield-wrapper"> | ||
<label class="audible" for="regular-toolbar-searchfield">Toolbar Searchfield</label> | ||
<input class="searchfield" placeholder="keyword" id="regular-toolbar-searchfield" name="regular-toolbar-searchfield" /> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="row top-padding"> | ||
<div class="twelve columns"> | ||
<button id="update-toolbar" class="btn-secondary"> | ||
<span>Update Toolbar</span> | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<script id="test-script"> | ||
// NOTE: IDS Initializer skips invoking Searchfields that are children of Toolbars by default, | ||
// so we have to manually invoke it here: | ||
$('#regular-toolbar-searchfield').searchfield(); | ||
var searchfieldAPI = $('#regular-toolbar-searchfield').data('searchfield'); | ||
|
||
$('body').on('initialized', function() { | ||
var toolbarElem = $('#regular-toolbar-example'); | ||
var toolbarAPI = toolbarElem.data('toolbar'); | ||
var btnUpdate = $('#update-toolbar'); | ||
|
||
btnUpdate.on('click', function() { | ||
toolbarAPI.updated(); | ||
}); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters