From f76623965c614a7786247aad5ff45fc6cde304c3 Mon Sep 17 00:00:00 2001 From: Per Cederberg Date: Fri, 22 Mar 2024 19:44:53 +0100 Subject: [PATCH] js: Deprecated RapidContext.Util.registerSizeConstraints() & resizeElements() --- src/plugin/system/files/app/admin/app.js | 7 ------- src/plugin/system/files/app/admin/ui.xml | 4 ++-- src/plugin/system/files/app/start/app.js | 7 +++---- src/plugin/system/files/css/widget.css | 2 ++ src/plugin/system/files/index.tmpl | 3 ++- .../system/files/js/RapidContext.Util.js | 6 ++++-- .../system/files/js/RapidContext_App.js | 9 +-------- .../files/js/RapidContext_Widget_Dialog.js | 4 ---- .../files/js/RapidContext_Widget_Pane.js | 1 - .../js/RapidContext_Widget_TabContainer.js | 20 +------------------ .../files/js/RapidContext_Widget_Table.js | 20 ------------------- .../js/RapidContext_Widget_TableColumn.js | 1 - .../files/js/RapidContext_Widget_TextArea.js | 10 ---------- .../files/js/RapidContext_Widget_Tree.js | 15 -------------- .../files/js/RapidContext_Widget_Wizard.js | 18 ++--------------- src/plugin/test/files/app/example/app.js | 1 - 16 files changed, 17 insertions(+), 111 deletions(-) diff --git a/src/plugin/system/files/app/admin/app.js b/src/plugin/system/files/app/admin/app.js index dca177b0..136716e1 100644 --- a/src/plugin/system/files/app/admin/app.js +++ b/src/plugin/system/files/app/admin/app.js @@ -118,11 +118,6 @@ AdminApp.prototype.start = function () { MochiKit.Signal.connect(this.ui.procExecResult, "onexpand", this, "_showExecDataExpand"); MochiKit.Signal.connect(this.ui.procArgForm, "onsubmit", this, "_updateProcArg"); this.ui.procExecLoading.hide(); - this.ui.procExecResult.resizeContent = function () { - var pos = MochiKit.Style.getElementPosition(this, this.parentNode); - var dim = MochiKit.Style.getElementDimensions(this.parentNode); - MochiKit.Style.setElementDimensions(this, { w: dim.w - 2, h: dim.h - pos.y - 2 }); - }; // Batch view MochiKit.Signal.connect(this.ui.batchDelete, "onclick", this, "_clearBatch"); @@ -726,7 +721,6 @@ AdminApp.prototype._showProcedure = function () { this.ui.procExec.disable(); this.ui.procBatch.disable(); this.ui.procExecResult.removeAll(); - RapidContext.Util.resizeElements(this.ui.procExecResult); if (node != null && node.data != null) { var cb = (res) => this._callbackShowProcedure(node.data, res); this.proc.procRead(node.data).then(cb, cb); @@ -784,7 +778,6 @@ AdminApp.prototype._callbackShowProcedure = function (procName, res) { this.ui.procExec.enable(); this.ui.procBatch.enable(); this.ui.procExecResult.removeAll(); - RapidContext.Util.resizeElements(this.ui.procExecResult); } }; diff --git a/src/plugin/system/files/app/admin/ui.xml b/src/plugin/system/files/app/admin/ui.xml index b3b80b47..f9fd04f5 100644 --- a/src/plugin/system/files/app/admin/ui.xml +++ b/src/plugin/system/files/app/admin/ui.xml @@ -301,7 +301,7 @@
-
+

Procedure Details: @@ -356,7 +356,7 @@

- + diff --git a/src/plugin/system/files/app/start/app.js b/src/plugin/system/files/app/start/app.js index cff13b86..e5a17310 100644 --- a/src/plugin/system/files/app/start/app.js +++ b/src/plugin/system/files/app/start/app.js @@ -161,11 +161,10 @@ StartApp.prototype._initDashboardApp = function (app) { var pane = new RapidContext.Widget.Pane(attrs); this.ui.inlinePane.insertBefore(pane, this.ui.inlinePane.firstChild); if (app.startPage == "left" || app.startPage == "right") { - RapidContext.Util.registerSizeConstraints(pane, "50%-3rem-3px"); + pane.style.width = "calc(50% - 3rem - 3px)"; } else { - RapidContext.Util.registerSizeConstraints(pane, "100%-3rem-3px"); + pane.style.width = "calc(100% - 3rem - 3px)"; } - RapidContext.Util.resizeElements(pane); this.startApp(app.className, pane); }; @@ -245,7 +244,7 @@ StartApp.prototype.initAppPane = function (pane, opts) { "class": "position-relative" }; pane = new RapidContext.Widget.Pane(attrs); - RapidContext.Util.registerSizeConstraints(pane, "100%", "100%"); + pane.style.width = pane.style.height = "100%"; this.ui.tabContainer.addAll(pane); if (!opts.background) { this.ui.tabContainer.selectChild(pane); diff --git a/src/plugin/system/files/css/widget.css b/src/plugin/system/files/css/widget.css index ae8f7c12..51aca011 100644 --- a/src/plugin/system/files/css/widget.css +++ b/src/plugin/system/files/css/widget.css @@ -376,6 +376,8 @@ button > .widgetIcon.fa, .widgetTabContainerContent { position: relative; top: -1px; + width: calc(100% - 20px); + height: calc(100% - 40px); border-top: 1px solid #ddd; padding: 10px 10px 0 10px; clear: both; diff --git a/src/plugin/system/files/index.tmpl b/src/plugin/system/files/index.tmpl index 3d1ce487..9e642bc9 100644 --- a/src/plugin/system/files/index.tmpl +++ b/src/plugin/system/files/index.tmpl @@ -59,7 +59,8 @@ %TITLE% - +