From f7e3dcb73b24a575cf0de15c7a98c49d35c914e7 Mon Sep 17 00:00:00 2001 From: Konstantin Loktev Date: Sat, 17 Dec 2022 12:12:12 +0300 Subject: [PATCH 1/4] feat: styles for new argument panel position --- client/static/components/css/common.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/static/components/css/common.css b/client/static/components/css/common.css index 57bbbffe..4586b920 100644 --- a/client/static/components/css/common.css +++ b/client/static/components/css/common.css @@ -153,7 +153,7 @@ div#footer { } .argument-container { - float: left; + display: flex; margin: 8px 0 0 8px; } @@ -162,7 +162,10 @@ div#footer { } .argument-buttons { + display: flex; margin-top: 2px; + margin-left: 1rem; + overflow-x: scroll; } .argument-translate-state { From 217f0c404d8f31635bb8816a66a0ab95044f3f82 Mon Sep 17 00:00:00 2001 From: Konstantin Loktev Date: Sat, 17 Dec 2022 12:12:29 +0300 Subject: [PATCH 2/4] feat: move arguments panel out of footer --- client/templates/base.html | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/client/templates/base.html b/client/templates/base.html index bafa4c38..b70d9eec 100644 --- a/client/templates/base.html +++ b/client/templates/base.html @@ -148,18 +148,19 @@

IMSOSTIS

{# Windows will be added later #}
+
+ + +
+ +
+
+ From 0e60d44d0c14cc1962cb2d8ff85e3d56a6e70f76 Mon Sep 17 00:00:00 2001 From: Konstantin Loktev Date: Sat, 17 Dec 2022 12:13:03 +0300 Subject: [PATCH 3/4] feat: don't show arguments panel when there are no arguments --- client/js/Ui/argumentspanel.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/client/js/Ui/argumentspanel.js b/client/js/Ui/argumentspanel.js index 47d1058b..5bcf32d1 100644 --- a/client/js/Ui/argumentspanel.js +++ b/client/js/Ui/argumentspanel.js @@ -4,6 +4,7 @@ SCWeb.ui.ArgumentsPanel = { init: function () { this.argument_add_state = false; var self = this; + this._parentContainer = document.getElementById('arguments_container'); return new Promise((resolve, reject)=>{ // listen events from arguments @@ -70,7 +71,9 @@ SCWeb.ui.ArgumentsPanel = { + idx_str + '">'; $(this._container).append(new_button); - + if(this._parentContainer.classList.contains('display-none')) { + this._parentContainer.classList.toggle('display-none'); + } // translate added argument SCWeb.core.Translation.translate([argument]).then(function (namesMap) { @@ -87,9 +90,10 @@ SCWeb.ui.ArgumentsPanel = { onArgumentRemoved: function (argument, idx) { $('#argument_' + idx.toString()).remove(); - // update indicies + // update indices + let noArguments = true; $(this._container + ' [arg_idx]').each(function (index, element) { - + noArguments = false; var v = parseInt($(this).attr('arg_idx')); if (v > idx) { @@ -98,11 +102,15 @@ SCWeb.ui.ArgumentsPanel = { $(this).attr('id', 'argument_' + v.toString()); } }); + if (noArguments) { + this._parentContainer.classList.toggle('display-none'); + } }, onArgumentsCleared: function () { $(this._container).empty(); + this._parentContainer.classList.toggle('display-none'); }, // ------- Translation listener interface --------- @@ -123,4 +131,4 @@ SCWeb.ui.ArgumentsPanel = { return SCWeb.core.Arguments._arguments; } -}; +}; \ No newline at end of file From 89b9fa840b6214af40a5408169bf25514f0f64c7 Mon Sep 17 00:00:00 2001 From: Konstantin Loktev Date: Sat, 17 Dec 2022 12:13:49 +0300 Subject: [PATCH 4/4] feat: display the clear arguments button after a delay --- client/templates/base.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/templates/base.html b/client/templates/base.html index b70d9eec..76585441 100644 --- a/client/templates/base.html +++ b/client/templates/base.html @@ -193,7 +193,10 @@

IMSOSTIS

}); }); - + + setTimeout(() => { + document.getElementById('arguments-btn-group').classList.toggle('display-none'); + }, 500);