summaryrefslogtreecommitdiffstats
path: root/client/lib/popup.js
diff options
context:
space:
mode:
authorXavier Priour <xavier.priour@bubblyware.com>2015-12-17 11:59:26 +0100
committerXavier Priour <xavier.priour@bubblyware.com>2015-12-17 11:59:26 +0100
commit43b1c4b576b8f0e4c342ec19684000a06809a253 (patch)
treec92938735d6ad7635b2cb9739c2b509829dbbf84 /client/lib/popup.js
parent4cea6fca908b4f9acd8687293041ebee86284883 (diff)
parentce88495d4783d2352bdc277a69496d90c38495ce (diff)
downloadwekan-43b1c4b576b8f0e4c342ec19684000a06809a253.tar.gz
wekan-43b1c4b576b8f0e4c342ec19684000a06809a253.tar.bz2
wekan-43b1c4b576b8f0e4c342ec19684000a06809a253.zip
Merge remote-tracking branch 'upstream/devel' into devel
Diffstat (limited to 'client/lib/popup.js')
-rw-r--r--client/lib/popup.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/client/lib/popup.js b/client/lib/popup.js
index 7418d938..797eb26d 100644
--- a/client/lib/popup.js
+++ b/client/lib/popup.js
@@ -1,10 +1,3 @@
-// A simple tracker dependency that we invalidate every time the window is
-// resized. This is used to reactively re-calculate the popup position in case
-// of a window resize. This is the equivalent of a "Signal" in some other
-// programming environments (eg, elm).
-const windowResizeDep = new Tracker.Dependency();
-$(window).on('resize', () => windowResizeDep.changed());
-
window.Popup = new class {
constructor() {
// The template we use to render popups
@@ -160,7 +153,10 @@ window.Popup = new class {
_getOffset(element) {
const $element = $(element);
return () => {
- windowResizeDep.depend();
+ Utils.windowResizeDep.depend();
+
+ if(Utils.isMiniScreen()) return { left:0, top:0 };
+
const offset = $element.offset();
const popupWidth = 300 + 15;
return {
@@ -183,7 +179,9 @@ window.Popup = new class {
// was available and returns `false`. There is a (small) risk a false
// positives.
const title = TAPi18n.__(translationKey);
- return title !== translationKey ? title : false;
+ // when popup showed as full of small screen, we need a default header to clearly see [X] button
+ const defaultTitle = Utils.isMiniScreen() ? 'Wekan' : false;
+ return title !== translationKey ? title : defaultTitle;
};
}
};