diff --git a/app/app/components/layout/zone-navigation.js b/app/app/components/layout/zone-navigation.js index a4d086a3..7ab541d6 100644 --- a/app/app/components/layout/zone-navigation.js +++ b/app/app/components/layout/zone-navigation.js @@ -11,12 +11,13 @@ import Ember from 'ember'; import netUtil from '../../utils/net'; +import TooltipMixin from '../../mixins/tooltip'; const { inject: { service } } = Ember; -export default Ember.Component.extend({ +export default Ember.Component.extend(TooltipMixin, { folderService: service('folder'), folder: null, appMeta: service(), @@ -51,6 +52,17 @@ export default Ember.Component.extend({ this.set('view.search', (route === 'search') ? true : false); }, + didRender() { + if (this.get('session.isAdmin')) { + this.addTooltip(document.getElementById("workspace-settings")); + } + if (this.get("session.authenticated")) { + this.addTooltip(document.getElementById("workspace-logout")); + } else { + this.addTooltip(document.getElementById("workspace-login")); + } + }, + actions: { switchAccount(domain) { this.audit.record('switched-account'); diff --git a/app/app/components/search/search-results.js b/app/app/components/search/search-results.js index c83c6482..b59f2bcf 100644 --- a/app/app/components/search/search-results.js +++ b/app/app/components/search/search-results.js @@ -12,44 +12,43 @@ import Ember from 'ember'; export default Ember.Component.extend({ - results: [], - resultPhrase: "", + results: [], + resultPhrase: "", - didReceiveAttrs() { - let results = this.get('results'); - let temp = _.groupBy(results, 'documentId'); - let documents = []; + didReceiveAttrs() { + let results = this.get('results'); + let temp = _.groupBy(results, 'documentId'); + let documents = []; - _.each(temp, function(document) { + _.each(temp, function (document) { let refs = []; if (document.length > 1) { refs = document.slice(1); } - _.each(refs, function(ref, index) { - ref.comma = index === refs.length-1 ? "" : ", "; + _.each(refs, function (ref, index) { + ref.comma = index === refs.length - 1 ? "" : ", "; }); let hasRefs = refs.length > 0; - documents.pushObject( { - doc: document[0], - ref: refs, + documents.pushObject({ + doc: document[0], + ref: refs, hasReferences: hasRefs - }); - }); + }); + }); - let phrase = 'Nothing found'; + let phrase = 'Nothing found'; - if (results.length > 0) { - let references = results.length === 1 ? "reference" : "references"; - let i = results.length; - let j = documents.length; - phrase = `${i} ${references}`; - } + if (results.length > 0) { + let references = results.length === 1 ? "reference" : "references"; + let i = results.length; + phrase = `${i} ${references}`; + } - this.set('resultPhrase', phrase); - this.set('documents', documents); - } + this.set('resultPhrase', phrase); + this.set('documents', documents); + } }); diff --git a/app/app/styles/widget/widget-notification.scss b/app/app/styles/widget/widget-notification.scss index 4c543d38..831ec9e1 100644 --- a/app/app/styles/widget/widget-notification.scss +++ b/app/app/styles/widget/widget-notification.scss @@ -1,24 +1,25 @@ .user-notification { - position: fixed; - display: none; - top: 20px; - right: 20px; - background-color: $color-toast; - color: $color-white; - padding: 10px 15px; - text-align: left; - border-radius: 2px; - @extend .z-depth-1; + position: fixed; + display: none; + top: 20px; + right: 20px; + background-color: $color-toast; + color: $color-white; + padding: 10px 15px; + text-align: left; + border-radius: 2px; + @extend .z-depth-1; + z-index: 999; - > .message { - margin: 3px 0; - padding: 0; - font-size: 0.9em; - } + > .message { + margin: 3px 0; + padding: 0; + font-size: 0.9em; + } } .busy-indicator { - height: 30px; - width: 30px; - margin: 0 10px; + height: 30px; + width: 30px; + margin: 0 10px; } diff --git a/app/app/styles/widget/widget-tooltip.scss b/app/app/styles/widget/widget-tooltip.scss index 767a6310..dc583dbb 100644 --- a/app/app/styles/widget/widget-tooltip.scss +++ b/app/app/styles/widget/widget-tooltip.scss @@ -2,163 +2,200 @@ .tooltip-element { z-index: 999; - box-sizing: border-box; - &:after, &:before { - box-sizing: border-box; - } - * { - box-sizing: border-box; - &:after, &:before { - box-sizing: border-box; - } - } - position: absolute; - display: none; - &.tooltip-open { - display: block; - } - &.tooltip-theme-arrows { - max-width: 100%; - max-height: 100%; - .tooltip-content { - border-radius: 2px; - position: relative; - font-family: inherit; - background: $color-tooltip; - color: $color-white; - padding: 0.5em; - font-size: 0.8em; - line-height: 1.1em; - &:before { - content: ""; - display: block; - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-width: 8px; - border-style: solid; - } - } - &.tooltip-element-attached-bottom.tooltip-element-attached-center .tooltip-content { - margin-bottom: 8px; - &:before { - top: 100%; - left: 50%; - margin-left: -8px; - border-top-color: $color-tooltip; - } - } - &.tooltip-element-attached-top.tooltip-element-attached-center .tooltip-content { - margin-top: 8px; - &:before { - bottom: 100%; - left: 50%; - margin-left: -8px; - border-bottom-color: $color-tooltip; - } - } - &.tooltip-element-attached-right.tooltip-element-attached-middle .tooltip-content { - margin-right: 8px; - &:before { - left: 100%; - top: 50%; - margin-top: -8px; - border-left-color: $color-tooltip; - } - } - &.tooltip-element-attached-left.tooltip-element-attached-middle .tooltip-content { - margin-left: 8px; - &:before { - right: 100%; - top: 50%; - margin-top: -8px; - border-right-color: $color-tooltip; - } - } - &.tooltip-element-attached-top { - &.tooltip-element-attached-left.tooltip-target-attached-bottom .tooltip-content { - margin-top: 8px; - &:before { - bottom: 100%; - left: 8px; - border-bottom-color: $color-tooltip; - } - } - &.tooltip-element-attached-right.tooltip-target-attached-bottom .tooltip-content { - margin-top: 8px; - &:before { - bottom: 100%; - right: 8px; - border-bottom-color: $color-tooltip; - } - } - } - &.tooltip-element-attached-bottom { - &.tooltip-element-attached-left.tooltip-target-attached-top .tooltip-content { - margin-bottom: 8px; - &:before { - top: 100%; - left: 8px; - border-top-color: $color-tooltip; - } - } - &.tooltip-element-attached-right.tooltip-target-attached-top .tooltip-content { - margin-bottom: 8px; - &:before { - top: 100%; - right: 8px; - border-top-color: $color-tooltip; - } - } - } - &.tooltip-element-attached-top { - &.tooltip-element-attached-right.tooltip-target-attached-left .tooltip-content { - margin-right: 8px; - &:before { - top: 8px; - left: 100%; - border-left-color: $color-tooltip; - } - } - &.tooltip-element-attached-left.tooltip-target-attached-right .tooltip-content { - margin-left: 8px; - &:before { - top: 8px; - right: 100%; - border-right-color: $color-tooltip; - } - } - } - &.tooltip-element-attached-bottom { - &.tooltip-element-attached-right.tooltip-target-attached-left .tooltip-content { - margin-right: 8px; - &:before { - bottom: 8px; - left: 100%; - border-left-color: $color-tooltip; - } - } - &.tooltip-element-attached-left.tooltip-target-attached-right .tooltip-content { - margin-left: 8px; - &:before { - bottom: 8px; - right: 100%; - border-right-color: $color-tooltip; - } - } - } - pointer-events: none; - .tooltip-content { - padding: 0.5em 1em; - } - } - opacity: 0; - &.tooltip-open-transitionend { - display: block; - } - &.tooltip-after-open { - transition: opacity 600ms 400ms; - opacity: 1; - } + box-sizing: border-box; + + &:after, + &:before { + box-sizing: border-box; + } + + * { + box-sizing: border-box; + + &:after, + &:before { + box-sizing: border-box; + } + } + position: absolute; + display: none; + + &.tooltip-open { + display: block; + } + + &.tooltip-theme-arrows { + z-index: 999; + max-width: 100%; + max-height: 100%; + + .tooltip-content { + border-radius: 2px; + position: relative; + font-family: inherit; + background: $color-tooltip; + color: $color-white; + padding: 0.5em; + font-size: 0.8em; + line-height: 1.1em; + + &:before { + content: ""; + display: block; + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-width: 8px; + border-style: solid; + } + } + + &.tooltip-element-attached-bottom.tooltip-element-attached-center .tooltip-content { + margin-bottom: 8px; + + &:before { + top: 100%; + left: 50%; + margin-left: -8px; + border-top-color: $color-tooltip; + } + } + + &.tooltip-element-attached-top.tooltip-element-attached-center .tooltip-content { + margin-top: 8px; + + &:before { + bottom: 100%; + left: 50%; + margin-left: -8px; + border-bottom-color: $color-tooltip; + } + } + + &.tooltip-element-attached-right.tooltip-element-attached-middle .tooltip-content { + margin-right: 8px; + + &:before { + left: 100%; + top: 50%; + margin-top: -8px; + border-left-color: $color-tooltip; + } + } + + &.tooltip-element-attached-left.tooltip-element-attached-middle .tooltip-content { + margin-left: 8px; + + &:before { + right: 100%; + top: 50%; + margin-top: -8px; + border-right-color: $color-tooltip; + } + } + + &.tooltip-element-attached-top { + &.tooltip-element-attached-left.tooltip-target-attached-bottom .tooltip-content { + margin-top: 8px; + + &:before { + bottom: 100%; + left: 8px; + border-bottom-color: $color-tooltip; + } + } + + &.tooltip-element-attached-right.tooltip-target-attached-bottom .tooltip-content { + margin-top: 8px; + + &:before { + bottom: 100%; + right: 8px; + border-bottom-color: $color-tooltip; + } + } + } + + &.tooltip-element-attached-bottom { + &.tooltip-element-attached-left.tooltip-target-attached-top .tooltip-content { + margin-bottom: 8px; + + &:before { + top: 100%; + left: 8px; + border-top-color: $color-tooltip; + } + } + + &.tooltip-element-attached-right.tooltip-target-attached-top .tooltip-content { + margin-bottom: 8px; + + &:before { + top: 100%; + right: 8px; + border-top-color: $color-tooltip; + } + } + } + + &.tooltip-element-attached-top { + &.tooltip-element-attached-right.tooltip-target-attached-left .tooltip-content { + margin-right: 8px; + + &:before { + top: 8px; + left: 100%; + border-left-color: $color-tooltip; + } + } + + &.tooltip-element-attached-left.tooltip-target-attached-right .tooltip-content { + margin-left: 8px; + + &:before { + top: 8px; + right: 100%; + border-right-color: $color-tooltip; + } + } + } + + &.tooltip-element-attached-bottom { + &.tooltip-element-attached-right.tooltip-target-attached-left .tooltip-content { + margin-right: 8px; + + &:before { + bottom: 8px; + left: 100%; + border-left-color: $color-tooltip; + } + } + + &.tooltip-element-attached-left.tooltip-target-attached-right .tooltip-content { + margin-left: 8px; + + &:before { + bottom: 8px; + right: 100%; + border-right-color: $color-tooltip; + } + } + } + pointer-events: none; + + .tooltip-content { + padding: 0.5em 1em; + } + } + opacity: 0; + + &.tooltip-open-transitionend { + display: block; + } + + &.tooltip-after-open { + transition: opacity 600ms 400ms; + opacity: 1; + } } diff --git a/app/app/templates/components/layout/zone-navigation.hbs b/app/app/templates/components/layout/zone-navigation.hbs index 37762e14..1aabd0a4 100644 --- a/app/app/templates/components/layout/zone-navigation.hbs +++ b/app/app/templates/components/layout/zone-navigation.hbs @@ -29,14 +29,14 @@