[dashboard] fix "edit" button on empty dashboard (#11031)

This commit is contained in:
Spencer 2017-04-06 18:45:34 -07:00 committed by GitHub
parent 546804f40c
commit 06da1becec
2 changed files with 3 additions and 1 deletions

View file

@ -66,7 +66,7 @@
<div ng-show="getShouldShowViewHelp()" class="text-center start-screen">
<h2>This dashboard is empty. Let's fill it up!</h2>
<p>Click the <a class="btn btn-xs navbtn-inverse" ng-click="kbnTopNav.open('edit');" aria-label="Edit">Edit</a> button in the menu bar above to start working on your new dashboard.
<p>Click the <a class="btn btn-xs navbtn-inverse" ng-click="kbnTopNav.click('edit');" aria-label="Edit">Edit</a> button in the menu bar above to start working on your new dashboard.
</div>
<dashboard-grid

View file

@ -58,6 +58,8 @@ export default function ($compile) {
open(key) { this.setCurrent(key); }
close(key) { (!key || this.isCurrent(key)) && this.setCurrent(null); }
toggle(key) { this.setCurrent(this.isCurrent(key) ? null : key); }
click(key) { this.handleClick(this.getItem(key)); }
getItem(key) { return this.menuItems.find(i => i.key === key); }
handleClick(menuItem) {
if (menuItem.disableButton()) {
return false;