restore the toggle logic in a way that actually works
This commit is contained in:
parent
514efd6af8
commit
2a324cd669
|
@ -34,16 +34,40 @@
|
|||
<button ng-click="newDashboard()" aria-label="New Dashboard"><i aria-hidden="true" class="fa fa-file-new-o"></i></button>
|
||||
</kbn-tooltip>
|
||||
<kbn-tooltip text="Save Dashboard" placement="bottom" append-to-body="1">
|
||||
<button aria-label="Save Dashboard" aria-haspopup="true" aria-expanded="{{toggleSaveDashboard}}" ng-click="configTemplate.toggle('save'); toggleSaveDashboard = !toggleSaveDashboard"><i aria-hidden="true" class="fa fa-save"></i></button>
|
||||
<button
|
||||
aria-label="Save Dashboard"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="{{ configTemplate.is('save') }}"
|
||||
ng-click="configTemplate.toggle('save');">
|
||||
<i aria-hidden="true" class="fa fa-save"></i>
|
||||
</button>
|
||||
</kbn-tooltip>
|
||||
<kbn-tooltip text="Load Saved Dashboard" placement="bottom" append-to-body="1">
|
||||
<button aria-label="Load Saved Dashboard" aria-haspopup="true" aria-expanded="{{toggleLoadSavedDashboard}}" ng-click="configTemplate.toggle('load'); toggleLoadSavedDashboard = !toggleLoadSavedDashboard"><i aria-hidden="true" class="fa fa-folder-open-o"></i></button>
|
||||
<button
|
||||
aria-label="Load Saved Dashboard"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="{{ configTemplate.is('load') }}"
|
||||
ng-click="configTemplate.toggle('load');">
|
||||
<i aria-hidden="true" class="fa fa-folder-open-o"></i>
|
||||
</button>
|
||||
</kbn-tooltip>
|
||||
<kbn-tooltip text="Share" placement="bottom" append-to-body="1">
|
||||
<button aria-label="Share Dashboard" aria-haspopup="true" aria-expanded="{{toggleShareDashboard}}" ng-click="configTemplate.toggle('share'); toggleShareDashboard = !toggleShareDashboard"><i aria-hidden="true" class="fa fa-external-link"></i></button>
|
||||
<button
|
||||
aria-label="Share Dashboard"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="{{ configTemplate.is('share') }}"
|
||||
ng-click="configTemplate.toggle('share');">
|
||||
<i aria-hidden="true" class="fa fa-external-link"></i>
|
||||
</button>
|
||||
</kbn-tooltip>
|
||||
<kbn-tooltip text="Add Visualization" placement="bottom" append-to-body="1">
|
||||
<button aria-label="Add Visualization" aria-haspopup="true" aria-expanded="{{toggleAddVisualization}}" ng-click="configTemplate.toggle('pickVis'); toggleAddVisualization = !toggleAddVisualization"><i aria-hidden="true" class="fa fa-plus-circle"></i></button>
|
||||
<button
|
||||
aria-label="Add Visualization"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="{{ configTemplate.is('pickVis') }}"
|
||||
ng-click="configTemplate.toggle('pickVis');">
|
||||
<i aria-hidden="true" class="fa fa-plus-circle"></i>
|
||||
</button>
|
||||
</kbn-tooltip>
|
||||
</div>
|
||||
</navbar>
|
||||
|
|
|
@ -24,13 +24,29 @@
|
|||
|
||||
<div class="button-group" role="toolbar">
|
||||
<kbn-tooltip text="New Search" placement="bottom" append-to-body="1">
|
||||
<button ng-click="newQuery()" aria-label="New Search"><i aria-hidden="true" class="fa fa-file-new-o"></i></button>
|
||||
<button
|
||||
ng-click="newQuery()"
|
||||
aria-label="New Search">
|
||||
<i aria-hidden="true" class="fa fa-file-new-o"></i>
|
||||
</button>
|
||||
</kbn-tooltip>
|
||||
<kbn-tooltip text="Save Search" placement="bottom" append-to-body="1">
|
||||
<button aria-haspopup="true" aria-expanded="{{toggleSaveSearch}}" ng-click="configTemplate.toggle('save');" aria-label="Save Search"><i aria-hidden="true" class="fa fa-save"></i></button>
|
||||
<button
|
||||
aria-haspopup="true"
|
||||
aria-expanded="{{ configTemplate.is('save') }}"
|
||||
ng-click="configTemplate.toggle('save');"
|
||||
aria-label="Save Search">
|
||||
<i aria-hidden="true" class="fa fa-save"></i>
|
||||
</button>
|
||||
</kbn-tooltip>
|
||||
<kbn-tooltip text="Load Saved Search" placement="bottom" append-to-body="1">
|
||||
<button aria-haspopup="true" aria-expanded="{{toggleLoadSavedSearch}}" ng-click="configTemplate.toggle('load');" aria-label="Load Saved Search"><i aria-hidden="true" class="fa fa-folder-open-o"></i></button>
|
||||
<button
|
||||
aria-haspopup="true"
|
||||
aria-expanded="{{ configTemplate.is('load') }}"
|
||||
ng-click="configTemplate.toggle('load');"
|
||||
aria-label="Load Saved Search">
|
||||
<i aria-hidden="true" class="fa fa-folder-open-o"></i>
|
||||
</button>
|
||||
</kbn-tooltip>
|
||||
</div>
|
||||
</navbar>
|
||||
|
|
|
@ -82,13 +82,29 @@
|
|||
</kbn-tooltip>
|
||||
|
||||
<kbn-tooltip text="Load Saved Visualization" placement="bottom" append-to-body="1">
|
||||
<button ng-click="configTemplate.toggle('load')" aria-label="Load Saved Visualization"><i aria-hidden="true" class="fa fa-folder-open-o"></i></button>
|
||||
<button
|
||||
aria-haspopup="true"
|
||||
aria-expanded="{{ configTemplate.is('load') }}"
|
||||
ng-click="configTemplate.toggle('load')"
|
||||
aria-label="Load Saved Visualization">
|
||||
<i aria-hidden="true" class="fa fa-folder-open-o"></i>
|
||||
</button>
|
||||
</kbn-tooltip>
|
||||
<kbn-tooltip text="Share Visualization" placement="bottom" append-to-body="1">
|
||||
<button ng-click="configTemplate.toggle('share')" aria-label="Share Visualization"><i aria-hidden="true" class="fa fa-external-link"></i></button>
|
||||
<button
|
||||
aria-haspopup="true"
|
||||
aria-expanded="{{ configTemplate.is('share') }}"
|
||||
ng-click="configTemplate.toggle('share')"
|
||||
aria-label="Share Visualization">
|
||||
<i aria-hidden="true" class="fa fa-external-link"></i>
|
||||
</button>
|
||||
</kbn-tooltip>
|
||||
<kbn-tooltip text="Refresh" placement="bottom" append-to-body="1">
|
||||
<button ng-click="fetch()" aria-label="Refresh"><i aria-hidden="true" class="fa fa-refresh"></i></button>
|
||||
<button
|
||||
ng-click="fetch()"
|
||||
aria-label="Refresh">
|
||||
<i aria-hidden="true" class="fa fa-refresh"></i>
|
||||
</button>
|
||||
</kbn-tooltip>
|
||||
</div>
|
||||
</navbar>
|
||||
|
|
|
@ -10,7 +10,7 @@ define(function (require) {
|
|||
|
||||
function update(newState, name) {
|
||||
var toUpdate = templates[name];
|
||||
var curState = template.current === toUpdate;
|
||||
var curState = template.is(name);
|
||||
if (newState == null) newState = !curState;
|
||||
|
||||
if (newState) {
|
||||
|
@ -22,6 +22,10 @@ define(function (require) {
|
|||
return newState;
|
||||
}
|
||||
|
||||
template.is = function (name) {
|
||||
return template.current === templates[name];
|
||||
};
|
||||
|
||||
template.toString = function () {
|
||||
return template.current;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue