Set focus to navbar search on initial login or when changing to home (closes #24)
This commit is contained in:
1
Changes
1
Changes
@@ -5,6 +5,7 @@
|
|||||||
* Icon to copy Navbar search text to Device Search Options field (closes #11)
|
* Icon to copy Navbar search text to Device Search Options field (closes #11)
|
||||||
* Typeahead on the main navbar search (for devices only)
|
* Typeahead on the main navbar search (for devices only)
|
||||||
* Support for have_nodeip_dns_col setting (closes #14)
|
* Support for have_nodeip_dns_col setting (closes #14)
|
||||||
|
* Set focus to navbar search on initial login or when changing to home (closes #24)
|
||||||
|
|
||||||
[ENHANCEMENTS]
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,15 @@ if (window.History && window.History.enabled) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
// activate typeahead on the main search box, for device names only
|
||||||
|
$('#nq').typeahead({
|
||||||
|
source: function (query, process) {
|
||||||
|
return $.get('/ajax/data/device/typeahead', { query: query }, function (data) {
|
||||||
|
return process(data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// activate tooltips
|
// activate tooltips
|
||||||
$("[rel=tooltip]").tooltip({live: true});
|
$("[rel=tooltip]").tooltip({live: true});
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,8 @@
|
|||||||
<input type="hidden" name="path" value="[% vars.requested_path %]"/>
|
<input type="hidden" name="path" value="[% vars.requested_path %]"/>
|
||||||
[% END %]
|
[% END %]
|
||||||
</form>
|
</form>
|
||||||
|
[% ELSE %]
|
||||||
|
<script type="text/javascript"> $('#nq').focus(); // set focus to navbar search </script>
|
||||||
[% END %]
|
[% END %]
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,13 +8,4 @@
|
|||||||
[% IF params.tab %]
|
[% IF params.tab %]
|
||||||
$('#[% params.tab %]_form').trigger("submit");
|
$('#[% params.tab %]_form').trigger("submit");
|
||||||
[% END %]
|
[% END %]
|
||||||
|
|
||||||
// enable typeahead on the main search box, for device names only
|
|
||||||
$('#nq').typeahead({
|
|
||||||
source: function (query, process) {
|
|
||||||
return $.get('/ajax/data/device/typeahead', { query: query }, function (data) {
|
|
||||||
return process(data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user