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 jezdez committed Oct 31, 2018
1 parent 9fbc9f7 commit 73970ea
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 hidden-xs" 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 @@ -498,6 +498,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 73970ea

Please sign in to comment.