From 2c90cb5907131336f2541ad89106541560260d68 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 28 Feb 2018 17:59:27 +0100 Subject: [PATCH] Move help button in drawer and fix drawer style --- customize.dist/src/less2/include/toolbar.less | 24 ++++++++++++++++++- customize.dist/translations/messages.fr.js | 7 +++--- customize.dist/translations/messages.js | 7 +++--- www/code/inner.js | 2 +- www/common/common-ui-elements.js | 11 ++++++++- www/pad/inner.js | 2 +- www/poll/inner.js | 2 +- www/slide/inner.js | 2 +- 8 files changed, 45 insertions(+), 12 deletions(-) diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index 6f49250f4..07e5eff61 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -855,6 +855,7 @@ font-size: 17px; } &> span { + order: 8; box-sizing: border-box; min-width: 150px; height: @toolbar_line-height; @@ -869,15 +870,36 @@ border: 0; width: 100%; line-height: 1em; + &.cp-toolbar-button-active { + background-color: inherit; + } .cp-toolbar-drawer-element { margin-left: 10px; display: inline; - vertical-align: top; + vertical-align: baseline; + } + &.fa-info-circle, &.fa-history, &.fa-cog { + .cp-toolbar-drawer-element { + margin-left: 11px; + } + } + &.fa-question { + .cp-toolbar-drawer-element { + margin-left: 16px; + } } &:hover { background-color: @colortheme_dropdown-bg-hover !important; color: @colortheme_dropdown-color; } + order: 8; + &.fa-history { order: 1; } + &.fa-download { order: 2; } + &.fa-upload { order: 3; } + &.fa-print { order: 4; } + &.fa-cog { order: 5; } + &.fa-info-circle { order: 6; } + &.fa-help { order: 7; } } } } diff --git a/customize.dist/translations/messages.fr.js b/customize.dist/translations/messages.fr.js index edf3362d4..145d50720 100644 --- a/customize.dist/translations/messages.fr.js +++ b/customize.dist/translations/messages.fr.js @@ -218,6 +218,10 @@ define(function () { out.cancelButton = 'Annuler (Échap)'; out.doNotAskAgain = "Ne plus demander (Échap)"; + out.show_help_button = "Afficher l'aide"; + out.hide_help_button = "Cacher l'aide"; + out.help_button = "Aide"; + out.historyText = "Historique"; out.historyButton = "Afficher l'historique du document"; out.history_next = "Voir la version suivante"; @@ -278,9 +282,6 @@ define(function () { out.poll_locked = "Verrouillé"; out.poll_unlocked = "Déverrouillé"; - out.poll_show_help_button = "Afficher l'aide"; - out.poll_hide_help_button = "Cacher l'aide"; - out.poll_bookmark_col = "Marquer cette colonne comme favorite pour qu'elle soit toujours déverouillée et affichée en première position."; out.poll_bookmarked_col = "Voici votre colonne favorite; elle sera toujours dévérouillée et affichée en première position."; out.poll_total = 'TOTAL'; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index 0dabbefe7..92702a339 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -220,6 +220,10 @@ define(function () { out.cancelButton = 'Cancel (esc)'; out.doNotAskAgain = "Don't ask me again (Esc)"; + out.show_help_button = "Show help"; + out.hide_help_button = "Hide help"; + out.help_button = "Help"; + out.historyText = "History"; out.historyButton = "Display the document history"; out.history_next = "Go to the next version"; @@ -280,9 +284,6 @@ define(function () { out.poll_locked = "Locked"; out.poll_unlocked = "Unlocked"; - out.poll_show_help_button = "Show help"; - out.poll_hide_help_button = "Hide help"; - out.poll_bookmark_col = 'Bookmark this column so that it is always unlocked and displayed at the beginning for you'; out.poll_bookmarked_col = 'This is your bookmarked column. It will always be unlocked and displayed at the beginning for you.'; out.poll_total = 'TOTAL'; diff --git a/www/code/inner.js b/www/code/inner.js index d7a9b25e4..c782c3f08 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -86,7 +86,7 @@ define([ $(helpMenu.text).html(DiffMd.render(Messages.codeInitialState)); - framework._.toolbar.$rightside.append(helpMenu.button); + framework._.toolbar.$drawer.append(helpMenu.button); }; var mkPreviewPane = function (editor, CodeMirror, framework, isPresentMode) { var $previewContainer = $('#cp-app-code-preview'); diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 9a5a1bc42..c72ea7b07 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -657,6 +657,11 @@ define([ data.element.toggle(); var isVisible = data.element.is(':visible'); if (callback) { callback(isVisible); } + if (isVisible) { + button.addClass('cp-toolbar-button-active'); + } else { + button.removeClass('cp-toolbar-button-active'); + } updateIcon(isVisible); }); updateIcon(data.element.is(':visible')); @@ -681,7 +686,6 @@ define([ default: button = $('