mirror of
https://github.com/documize/community.git
synced 2025-07-22 14:49:42 +02:00
improved tooltips
This commit is contained in:
parent
6a651770b5
commit
a86d52388e
4 changed files with 34 additions and 14 deletions
|
@ -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")))
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -1,26 +1,18 @@
|
|||
<div id="zone-navigation" class="zone-navigation">
|
||||
<ul id="top-zone" class="top-zone">
|
||||
{{#if session.hasAccounts}}
|
||||
<li>
|
||||
<li id="accounts-button" data-tooltip="Switch team" data-tooltip-position="right center">
|
||||
<div id="accounts-button" class="round-button-mono button-white">
|
||||
<i class="material-icons">apps</i>
|
||||
</div>
|
||||
</li>
|
||||
{{else}}
|
||||
<li>
|
||||
{{#link-to 'folders' class='title'}}
|
||||
<div class="round-button-mono button-white" title={{appMeta.title}}>
|
||||
<i class="material-icons">apps</i>
|
||||
</div>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/if}}
|
||||
<li class="{{if view.folder 'selected'}}">
|
||||
<li id="home-button" class="{{if view.folder 'selected'}}" data-tooltip="Home" data-tooltip-position="right center">
|
||||
{{#link-to 'folders' tagName="div" class="round-button-mono button-white"}}
|
||||
<i class="material-icons">home</i>
|
||||
{{/link-to}}
|
||||
</li>
|
||||
<li class="{{if view.search 'selected'}}">
|
||||
<li id="search-button" class="{{if view.search 'selected'}}" data-tooltip="Search" data-tooltip-position="right center">
|
||||
{{#link-to 'search' tagName="div" class="round-button-mono button-white"}}
|
||||
<i class="material-icons icon-tool">search</i>
|
||||
{{/link-to}}
|
||||
|
@ -44,7 +36,7 @@
|
|||
</li>
|
||||
{{/if}}
|
||||
{{#if session.authenticated}}
|
||||
<li class="{{if view.profile 'selected'}}">
|
||||
<li id="user-profile-button" class="{{if view.profile 'selected'}}" data-tooltip="Profile" data-tooltip-position="right center">
|
||||
{{#link-to 'profile'}}
|
||||
<div class="round-button-mono button-white">
|
||||
<i class="material-icons profile-link">{{session.user.initials}}</i>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue