summaryrefslogtreecommitdiffstats
path: root/client/lib
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-06-06 10:15:54 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-06-06 10:15:54 +0200
commit56a240a643ca01c96fb76abc715759ee0f485186 (patch)
tree870cb6a78ee33f51048e2427444dbe2ba3fcd0cb /client/lib
parentdea52907bdbed92c95dec7e7e832ac95d9f9d388 (diff)
downloadwekan-56a240a643ca01c96fb76abc715759ee0f485186.tar.gz
wekan-56a240a643ca01c96fb76abc715759ee0f485186.tar.bz2
wekan-56a240a643ca01c96fb76abc715759ee0f485186.zip
Maintain a visual indication of the popup openerElement
Diffstat (limited to 'client/lib')
-rw-r--r--client/lib/popup.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/client/lib/popup.js b/client/lib/popup.js
index 6ec7dfdb..fe8b581b 100644
--- a/client/lib/popup.js
+++ b/client/lib/popup.js
@@ -19,9 +19,13 @@ Popup = {
return function(evt) {
// If a popup is already openened, clicking again on the opener element
// should close it -- and interupt the current `open` function.
- if (self.isOpen() &&
- self._getTopStack().openerElement === evt.currentTarget) {
- return self.close();
+ if (self.isOpen()) {
+ var previousOpenerElement = self._getTopStack().openerElement;
+ if (previousOpenerElement === evt.currentTarget) {
+ return self.close();
+ } else {
+ $(previousOpenerElement).removeClass('is-active');
+ }
}
// We determine the `openerElement` (the DOM element that is being clicked
@@ -36,6 +40,7 @@ Popup = {
self._stack = [];
openerElement = evt.currentTarget;
}
+ $(openerElement).addClass('is-active');
// We modify the event to prevent the popup being closed when the event
// bubble up to the document element.
@@ -122,6 +127,10 @@ Popup = {
if (this.isOpen()) {
Blaze.remove(this.current);
this.current = null;
+
+ var openerElement = this._getTopStack().openerElement;
+ $(openerElement).removeClass('is-active');
+
this._stack = [];
}
},