Fix popover closing on input focus

Signed-off-by: Marin Treselj <marin@pixelipo.com>
This commit is contained in:
Marin Treselj
2017-05-24 11:59:20 +02:00
parent ec6c8d94c1
commit 1143f0807c
2 changed files with 7 additions and 7 deletions

View File

@@ -37,7 +37,8 @@ app.directive('appPopoverMenuUtils', function () {
e.stopPropagation(); e.stopPropagation();
}); });
scope.$on('documentClicked', function (scope, event) { scope.$on('documentClicked', function (scope, event) {
if (event.target !== button) { /* prevent closing popover if target has no-close class */
if (event.target !== button && !$(event.target).hasClass('no-close')) {
menu.addClass('hidden'); menu.addClass('hidden');
} }
button.css('display',''); button.css('display','');
@@ -45,4 +46,3 @@ app.directive('appPopoverMenuUtils', function () {
} }
}; };
}); });

View File

@@ -43,7 +43,7 @@
<div id="popover-controls"> <div id="popover-controls">
<div id="stack-add" ng-if="boardservice.canEdit() && checkCanEdit()"> <div id="stack-add" ng-if="boardservice.canEdit() && checkCanEdit()">
<form class="ng-pristine ng-valid" ng-submit="createStack()"> <form class="ng-pristine ng-valid" ng-submit="createStack()">
<input type="text" placeholder="Add a new stack" <input type="text" class="no-close" placeholder="Add a new stack"
ng-focus="status.addStack=true" ng-focus="status.addStack=true"
ng-blur="status.addStack=false" ng-blur="status.addStack=false"
ng-model="newStack.title" required ng-model="newStack.title" required