-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51148a2
commit 5dbddbe
Showing
1 changed file
with
42 additions
and
0 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> |