From b365f7d9e1fb4168881177e63c4bc59bcc089a70 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 29 Nov 2019 12:06:23 +0100 Subject: [PATCH] wip #3186 @0.5 --- images/interface.svg | 11 +++ .../fluidbook/links/fluidbook.links.zoom.js | 22 +++-- style/fluidbook.less | 98 +------------------ style/tooltip.less | 98 +++++++++++++++++++ 4 files changed, 124 insertions(+), 105 deletions(-) create mode 100644 style/tooltip.less diff --git a/images/interface.svg b/images/interface.svg index e80f8558..204cf2e7 100644 --- a/images/interface.svg +++ b/images/interface.svg @@ -35,6 +35,17 @@ c-0.1-0.2-0.3-0.4-0.5-0.4c-0.2,0-0.5,0.1-0.6,0.2l-2,2.4l-0.7-0.6l2-2.4c0.2-0.2,0.2-0.4,0.1-0.7C5.4,16,5.2,15.8,5,15.8l-1.3-0.4 l6.2-3.3L7.7,18.8z"/> + + + + + + '); if ($groupWrapper.find('.zoomPopupClose').length === 0) { var menu = '
'; - if (zoomLink.data('shareurl') !== undefined) { - menu += '' + getSpriteIcon('nav-share') + ''; - } - if (zoomLink.data('producturl') !== undefined) { - var label = this.fluidbook.datas.product_zoom_label_1 !== '' ? this.fluidbook.datas.product_zoom_label_1 : this.fluidbook.l10n.__('see on the website'); - var icon = getSpriteIcon(this.fluidbook.datas.product_zoom_icon_1) !== 'none' ? getSpriteIcon(this.fluidbook.datas.product_zoom_icon_1) : ''; - menu += '' + icon + '' + label + ''; + if (zoomLink.data('shareurl') !== undefined && zoomLink.data('shareurl') !== '') { + menu += '' + getSpriteIcon('nav-share') + ''; } if (zoomLink.data('extra-1') !== undefined) { var label = this.fluidbook.datas.product_zoom_label_2; var icon = getSpriteIcon(this.fluidbook.datas.product_zoom_icon_2) !== 'none' ? getSpriteIcon(this.fluidbook.datas.product_zoom_icon_2) : ''; - menu += '' + icon + '' + label + ''; + var linkClass = ""; + if (label !== '') { + label = '' + label + ''; + } else { + linkClass = " nolabel"; + } + menu += '' + icon + label + ''; + } + if (zoomLink.data('producturl') !== undefined && zoomLink.data('producturl') !== '') { + var label = this.fluidbook.datas.product_zoom_label_1 !== '' ? this.fluidbook.datas.product_zoom_label_1 : this.fluidbook.l10n.__('see on the website'); + var icon = getSpriteIcon(this.fluidbook.datas.product_zoom_icon_1) !== 'none' ? getSpriteIcon(this.fluidbook.datas.product_zoom_icon_1) : ''; + menu += '' + icon + '' + label + ''; } menu += '
'; $groupWrapper.append('
' + menu + '
'); diff --git a/style/fluidbook.less b/style/fluidbook.less index 176dc015..1c8810ce 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -2578,103 +2578,7 @@ ul.chapters { } -/* Tooltip */ - -#tooltip { - @tooltip-arrows-size: 10px; - - position: absolute; - background-color: @tooltip-background; - color: @tooltip-color; - top: 0px; - left: 0px; - padding: 20px 25px; - border-radius: 3px; - display: none; - font-size: unit(@tooltip-font-size, px); - z-index: 100; - white-space: pre-wrap; - line-height: 1.14; - -moz-transform-origin: 0 0; - -ms-transform-origin: 0 0; - -o-transform-origin: 0 0; - -webkit-transform-origin: 0 0; - transform-origin: 0 0; - box-sizing: border-box; - pointer-events: none; - - &[data-style="invert"] { - font-weight: 700; - background-color: @tooltip-color; - color: @tooltip-background; - - &[data-pos-y="n"] { - &:after { - border-bottom-color: @tooltip-color; - } - } - - &[data-pos-y="s"] { - &:after { - border-top-color: @tooltip-color; - } - } - } - - &[data-style="error"] { - font-weight: 700; - background-color: #cc0000; - color: #fff; - - &[data-pos-y="n"] { - &:after { - border-bottom-color: #cc0000; - } - } - - &[data-pos-y="s"] { - &:after { - border-top-color: #cc0000; - } - } - } - - &:after { - content: ""; - position: absolute; - width: 0; - height: 0; - border-left: @tooltip-arrows-size solid transparent; - border-right: @tooltip-arrows-size solid transparent; - display: block; - } - - &[data-pos-y="n"] { - &:after { - border-bottom: @tooltip-arrows-size solid @tooltip-background; - top: unit(@tooltip-arrows-size*-1, px); - } - } - - &[data-pos-y="s"] { - &:after { - border-top: @tooltip-arrows-size solid @tooltip-background; - bottom: unit(@tooltip-arrows-size*-1, px); - } - } - - &[data-pos-x="w"] { - &:after { - left: 16px; - } - } - - &[data-pos-x="e"] { - &:after { - right: 16px; - } - } -} +@import "tooltip"; /* Privacy settings */ diff --git a/style/tooltip.less b/style/tooltip.less new file mode 100644 index 00000000..5627ba6a --- /dev/null +++ b/style/tooltip.less @@ -0,0 +1,98 @@ + +/* Tooltip */ + +#tooltip { + @tooltip-arrows-size: 10px; + + position: absolute; + background-color: @tooltip-background; + color: @tooltip-color; + top: 0px; + left: 0px; + padding: 20px 25px; + border-radius: 3px; + display: none; + font-size: unit(@tooltip-font-size, px); + z-index: 102; + white-space: pre-wrap; + line-height: 1.14; + -moz-transform-origin: 0 0; + -ms-transform-origin: 0 0; + -o-transform-origin: 0 0; + -webkit-transform-origin: 0 0; + transform-origin: 0 0; + box-sizing: border-box; + pointer-events: none; + + &[data-style="invert"] { + font-weight: 700; + background-color: @tooltip-color; + color: @tooltip-background; + + &[data-pos-y="n"] { + &:after { + border-bottom-color: @tooltip-color; + } + } + + &[data-pos-y="s"] { + &:after { + border-top-color: @tooltip-color; + } + } + } + + &[data-style="error"] { + font-weight: 700; + background-color: #cc0000; + color: #fff; + + &[data-pos-y="n"] { + &:after { + border-bottom-color: #cc0000; + } + } + + &[data-pos-y="s"] { + &:after { + border-top-color: #cc0000; + } + } + } + + &:after { + content: ""; + position: absolute; + width: 0; + height: 0; + border-left: @tooltip-arrows-size solid transparent; + border-right: @tooltip-arrows-size solid transparent; + display: block; + } + + &[data-pos-y="n"] { + &:after { + border-bottom: @tooltip-arrows-size solid @tooltip-background; + top: unit(@tooltip-arrows-size*-1, px); + } + } + + &[data-pos-y="s"] { + &:after { + border-top: @tooltip-arrows-size solid @tooltip-background; + bottom: unit(@tooltip-arrows-size*-1, px); + } + } + + &[data-pos-x="w"] { + &:after { + left: 16px; + } + } + + &[data-pos-x="e"] { + &:after { + right: 16px; + } + } +} \ No newline at end of file -- 2.39.5