mirror of
https://github.com/documize/community.git
synced 2025-07-22 22:59:43 +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,
|
isPinned: false,
|
||||||
pinId: '',
|
pinId: '',
|
||||||
newName: '',
|
newName: '',
|
||||||
|
tip: null
|
||||||
},
|
},
|
||||||
deleteSpaceName: '',
|
deleteSpaceName: '',
|
||||||
|
|
||||||
|
@ -63,6 +64,18 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, AuthMixin, {
|
||||||
if (this.get('permissions.spaceManage')) {
|
if (this.get('permissions.spaceManage')) {
|
||||||
this.addTooltip(document.getElementById("space-settings-button"));
|
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 {
|
} else {
|
||||||
this.addTooltip(document.getElementById("workspace-login"));
|
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() {
|
setupPins() {
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default Ember.Mixin.create({
|
||||||
tooltips: [],
|
tooltips: [],
|
||||||
|
|
||||||
addTooltip(elem) {
|
addTooltip(elem) {
|
||||||
|
|
||||||
if(elem == null) {
|
if(elem == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,13 @@ export default Ember.Mixin.create({
|
||||||
});
|
});
|
||||||
|
|
||||||
let tt = this.get('tooltips');
|
let tt = this.get('tooltips');
|
||||||
tt.push(t);
|
tt.push(t);
|
||||||
|
|
||||||
|
return t;
|
||||||
|
},
|
||||||
|
|
||||||
|
destroyTooltip(t) {
|
||||||
|
t.destroy();
|
||||||
},
|
},
|
||||||
|
|
||||||
destroyTooltips() {
|
destroyTooltips() {
|
||||||
|
|
|
@ -1,26 +1,18 @@
|
||||||
<div id="zone-navigation" class="zone-navigation">
|
<div id="zone-navigation" class="zone-navigation">
|
||||||
<ul id="top-zone" class="top-zone">
|
<ul id="top-zone" class="top-zone">
|
||||||
{{#if session.hasAccounts}}
|
{{#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">
|
<div id="accounts-button" class="round-button-mono button-white">
|
||||||
<i class="material-icons">apps</i>
|
<i class="material-icons">apps</i>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</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}}
|
{{/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"}}
|
{{#link-to 'folders' tagName="div" class="round-button-mono button-white"}}
|
||||||
<i class="material-icons">home</i>
|
<i class="material-icons">home</i>
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
</li>
|
</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"}}
|
{{#link-to 'search' tagName="div" class="round-button-mono button-white"}}
|
||||||
<i class="material-icons icon-tool">search</i>
|
<i class="material-icons icon-tool">search</i>
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
|
@ -44,7 +36,7 @@
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if session.authenticated}}
|
{{#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'}}
|
{{#link-to 'profile'}}
|
||||||
<div class="round-button-mono button-white">
|
<div class="round-button-mono button-white">
|
||||||
<i class="material-icons profile-link">{{session.user.initials}}</i>
|
<i class="material-icons profile-link">{{session.user.initials}}</i>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue