From a86d52388e40298e7b6479a3e948c58c849dc8ec Mon Sep 17 00:00:00 2001 From: Harvey Kandola Date: Tue, 19 Sep 2017 09:21:51 +0100 Subject: [PATCH] improved tooltips --- gui/app/components/folder/folder-toolbar.js | 13 +++++++++++++ gui/app/components/layout/zone-navigation.js | 9 +++++++++ gui/app/mixins/tooltip.js | 10 ++++++++-- .../components/layout/zone-navigation.hbs | 16 ++++------------ 4 files changed, 34 insertions(+), 14 deletions(-) diff --git a/gui/app/components/folder/folder-toolbar.js b/gui/app/components/folder/folder-toolbar.js index e8c12e80..15f4affd 100644 --- a/gui/app/components/folder/folder-toolbar.js +++ b/gui/app/components/folder/folder-toolbar.js @@ -32,6 +32,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, AuthMixin, { isPinned: false, pinId: '', newName: '', + tip: null }, deleteSpaceName: '', @@ -63,6 +64,18 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, AuthMixin, { if (this.get('permissions.spaceManage')) { this.addTooltip(document.getElementById("space-settings-button")); } + if (this.get('session.authenticated')) { + let t = this.get('pinState.tip'); + if (is.not.null(t)) { + t.destroy(); + } + + if (this.get('pinState.isPinned')) { + this.set('pinState.tip', this.addTooltip(document.getElementById("space-unpin-button"))) + } else { + this.set('pinState.tip', this.addTooltip(document.getElementById("space-pin-button"))) + } + } } }, diff --git a/gui/app/components/layout/zone-navigation.js b/gui/app/components/layout/zone-navigation.js index 59507398..e0cf20c6 100644 --- a/gui/app/components/layout/zone-navigation.js +++ b/gui/app/components/layout/zone-navigation.js @@ -99,6 +99,15 @@ export default Ember.Component.extend(TooltipMixin, { } else { this.addTooltip(document.getElementById("workspace-login")); } + if (this.get("session.authenticated")) { + this.addTooltip(document.getElementById("user-profile-button")); + } + if (this.get('session.hasAccounts')) { + this.addTooltip(document.getElementById("accounts-button")); + } + + this.addTooltip(document.getElementById("home-button")); + this.addTooltip(document.getElementById("search-button")); }, setupPins() { diff --git a/gui/app/mixins/tooltip.js b/gui/app/mixins/tooltip.js index bb7a0a04..06fe6e84 100644 --- a/gui/app/mixins/tooltip.js +++ b/gui/app/mixins/tooltip.js @@ -15,7 +15,7 @@ export default Ember.Mixin.create({ tooltips: [], addTooltip(elem) { - + if(elem == null) { return; } @@ -25,7 +25,13 @@ export default Ember.Mixin.create({ }); let tt = this.get('tooltips'); - tt.push(t); + tt.push(t); + + return t; + }, + + destroyTooltip(t) { + t.destroy(); }, destroyTooltips() { diff --git a/gui/app/templates/components/layout/zone-navigation.hbs b/gui/app/templates/components/layout/zone-navigation.hbs index 1354cd05..6b5e19ad 100644 --- a/gui/app/templates/components/layout/zone-navigation.hbs +++ b/gui/app/templates/components/layout/zone-navigation.hbs @@ -1,26 +1,18 @@