Skip to content

Commit

Permalink
hide query more menu if empty (re #208)
Browse files Browse the repository at this point in the history
  • Loading branch information
spasovski authored and Allen Short committed Jul 30, 2018
1 parent e9f82a4 commit dc228cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/app/pages/queries/query.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ <h3>
</a>
</span>

<div ng-if="query.id != undefined" class="btn-group" role="group" uib-dropdown>
<div ng-show="moreMenuIsPopulated()" id="query-more-menu" ng-if="query.id != undefined" class="btn-group" role="group" uib-dropdown>
<button class="btn btn-default dropdown-toggle" uib-dropdown-toggle>
<span class="zmdi zmdi-more"></span>
</button>
Expand Down
11 changes: 11 additions & 0 deletions client/app/pages/queries/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,17 @@ function QueryViewCtrl(
},
});
};

$scope.moreMenuIsPopulated = () => {
const menuParent = document.getElementById('query-more-menu');

if (menuParent) {
if (menuParent.querySelectorAll('.dropdown-menu li').length) {
return true;
}
}
return false;
};
}

export default function init(ngModule) {
Expand Down

0 comments on commit dc228cc

Please sign in to comment.