From dc96ac9810f5d7b0f0119973c600c26a4ab460bb Mon Sep 17 00:00:00 2001 From: volterra79 Date: Wed, 5 Feb 2025 12:22:46 +0100 Subject: [PATCH 1/6] :sparkles: Customize enable and tooltip property of close sidebar panel button --- src/components/App.vue | 19 ++++++++++++------- src/store/application.js | 11 ++++++++++- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/components/App.vue b/src/components/App.vue index 2dc544b15..681453d7a 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -235,15 +235,19 @@ - + + @@ -563,6 +567,7 @@ export default { updatePreviousTitle: false, header: t('main navigation'), custom_links, + sidebar: ApplicationState.gui.sidebar, } }, diff --git a/src/store/application.js b/src/store/application.js index 640c08ffe..dd0e74b7a 100644 --- a/src/store/application.js +++ b/src/store/application.js @@ -103,7 +103,16 @@ const STATE = Vue.observable({ * @since v3.11.0 * true open, false hide - icons only */ - open : true + open : true, + /** + * @since 3.11.3 + */ + buttons : { + close: { + enabled: true, + tooltip: 'close' + } + } }, layout: { From 511e31b040aa572f72e5ba223342b3e0acebb9b6 Mon Sep 17 00:00:00 2001 From: volterra79 Date: Wed, 5 Feb 2025 12:27:39 +0100 Subject: [PATCH 2/6] :bug: handle closeAllPanels method when enabled --- src/components/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/App.vue b/src/components/App.vue index 681453d7a..fe7774150 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -235,7 +235,7 @@ Date: Mon, 10 Feb 2025 09:32:16 +0100 Subject: [PATCH 3/6] :sparkles: Add internal Vue $gui sidebar method and attributes to handle sidebar close button --- src/components/App.vue | 9 ++++----- src/index.prod.js | 25 +++++++++++++++++++++++++ src/store/application.js | 9 --------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/components/App.vue b/src/components/App.vue index fe7774150..0a929bf6a 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -211,7 +211,7 @@ >
@@ -238,13 +238,13 @@ @click.stop = "sidebar.buttons.close.enabled && closeAllPanels()" data-toggle = "tooltip" data-container = "body" - v-t-tooltip:top.create = "sidebar.buttons.close.tooltip" - :current-tooltip = "sidebar.buttons.close.tooltip" + v-t-tooltip:top.create = "$gui.sidebar.buttons.close.tooltip" + :current-tooltip = "$gui.sidebar.buttons.close.tooltip" class = "skin-tooltip-left g3w-span-button close-pane-button fa-stack" > @@ -567,7 +567,6 @@ export default { updatePreviousTitle: false, header: t('main navigation'), custom_links, - sidebar: ApplicationState.gui.sidebar, } }, diff --git a/src/index.prod.js b/src/index.prod.js index 434723420..c68cf2d5e 100644 --- a/src/index.prod.js +++ b/src/index.prod.js @@ -127,6 +127,31 @@ Vue.use(require('vue-cookie')); */ Vue.use({ install(Vue) { + /** + * @since 3.11.3 Sidebar + */ + Vue.prototype.$gui = { + updateSidebarButton({ type, opts = {}} = {}) { + if (undefined === this.sidebar.buttons[type]) { + return; + } + Object.keys(opts).forEach(k => this.sidebar.buttons[type][k] = opts[k] ); + }, + sidebar: Vue.observable({ + /** + * + * @param type + * @param opts + */ + buttons : { + close: { + enabled: true, + tooltip: 'close' + } + } + }) + }; + /** @since 3.11.0 */ Vue.prototype.$t = t; // hold a list of registered fontawsome classes for current project diff --git a/src/store/application.js b/src/store/application.js index dd0e74b7a..ba39b31ab 100644 --- a/src/store/application.js +++ b/src/store/application.js @@ -104,15 +104,6 @@ const STATE = Vue.observable({ * true open, false hide - icons only */ open : true, - /** - * @since 3.11.3 - */ - buttons : { - close: { - enabled: true, - tooltip: 'close' - } - } }, layout: { From 2abecf82830ffc81f0b756b67391d28910818ef9 Mon Sep 17 00:00:00 2001 From: volterra79 Date: Mon, 10 Feb 2025 11:17:24 +0100 Subject: [PATCH 4/6] :bug: missing $gui. --- src/components/App.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/App.vue b/src/components/App.vue index 0a929bf6a..b3593058c 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -235,7 +235,7 @@ Date: Tue, 11 Feb 2025 12:41:55 +0100 Subject: [PATCH 5/6] font-family --- src/components/QueryBuilder.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/QueryBuilder.vue b/src/components/QueryBuilder.vue index 46cde5517..c7837aa26 100644 --- a/src/components/QueryBuilder.vue +++ b/src/components/QueryBuilder.vue @@ -375,7 +375,6 @@ export default {