Skip to content

Commit

Permalink
Disable Export Everything button when templates doesn't exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sw-jung committed Dec 25, 2017
1 parent 2258203 commit ce69d76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions public/management/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ <h1 class="kuiTitle">
<button
class="kuiButton kuiButton--basic kuiButton--iconText"
ng-click="export(templates)"
ng-disabled="!templates.length"
>
<span class="kuiButton__inner">
<span aria-hidden="true" class="kuiButton__icon kuiIcon fa-download"></span>
Expand Down
2 changes: 1 addition & 1 deletion public/management/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ uiRoutes
};

$scope.export = (items = []) => {
if (!items.length) notify.error('No templates to export.');
if (!items.length) return notify.error('No templates to export.');
const blob = new Blob([
angular.toJson(items.map(item => pick(item, ['_id', '_type', '_source'])), true)
], {
Expand Down

0 comments on commit ce69d76

Please sign in to comment.