Skip to content

Commit 5c318a5

Browse files
committed
[webgeom] let resize hierarchy view
Like in RBrowser, resize hierarchy page when single collumn is resized
1 parent 726a72d commit 5c318a5

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

ui5/geom/controller/GeomHierarchy.controller.js

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
2727

2828
"use strict";
2929

30-
/** @summary Central geometry viewer contoller
30+
/** @summary Central geometry viewer controller
3131
* @desc All TGeo functionality is loaded after main ui5 rendering is performed,
3232
* To start drawing, following stages should be completed:
3333
* - ui5 element is rendered (onAfterRendering is called)
@@ -59,7 +59,7 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
5959

6060
configure(args) {
6161
this.jsroot = args.jsroot;
62-
this.websocket = args.websocket; // special channel created from main conection
62+
this.websocket = args.websocket; // special channel created from main connection
6363
this.viewer = args.viewer;
6464
this.standalone = args.standalone;
6565
this.websocket.setReceiver(this);
@@ -134,10 +134,28 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
134134
}));
135135
}
136136

137+
this._columnResized = 0;
138+
137139
// catch re-rendering of the table to assign handlers
138140
t.addEventDelegate({
139-
onAfterRendering: function() { this.assignRowHandlers(); }
141+
onAfterRendering() {
142+
this.assignRowHandlers();
143+
if (this._columnResized < 1) return;
144+
this._columnResized = 0;
145+
let fullsz = 4;
146+
147+
t.getColumns().forEach(col => {
148+
if (col.getVisible()) fullsz += 4 + col.$().width();
149+
});
150+
151+
this.viewer?.byId('geomViewerApp').getAggregation('_navMaster').setWidth(fullsz + 'px');
152+
}
153+
}, this);
154+
155+
t.attachEvent("columnResize", {}, evnt => {
156+
this._columnResized++;
140157
}, this);
158+
141159
},
142160

143161
/** @summary invoked when visibility checkbox clicked */
@@ -205,7 +223,7 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
205223
return ttt?.id ?? -1;
206224
},
207225

208-
/** @summary Return arrys of ids for this row */
226+
/** @summary Return arrays of ids for this row */
209227
getRowIds(row) {
210228
let ctxt = row.getBindingContext();
211229
if (!ctxt) return null;
@@ -273,7 +291,7 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
273291
onWebsocketMsg(handle, msg /*, offset */) {
274292

275293
// binary data can be send only as addition to draw message
276-
// here data can be placed in the queue and processed when all other prerequicities are done
294+
// here data can be placed in the queue and processed when all other prerequisites are done
277295
if (typeof msg != "string")
278296
return console.error("Geom hierarchy not uses binary messages len = " + mgs.byteLength);
279297

@@ -466,7 +484,6 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
466484

467485
/** @summary Show found nodes in the browser, used for offline */
468486
showFoundNodes(matches) {
469-
470487
let br = this.byId("treeTable"), nodes = [];
471488
for (let k = 0; k < matches.length; ++k)
472489
this.viewer?.appendStackToTree(nodes, matches[k].stack, matches[k].color, matches[k].material);
@@ -482,7 +499,6 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
482499
/** @summary method called from geom painter when specific node need to be activated in the browser
483500
* @desc Due to complex indexing in TreeTable it is not trivial to select special node */
484501
activateInTreeTable(itemname) {
485-
486502
if (!itemname || !this.model) return;
487503

488504
let index = this.model.expandNodeByPath(itemname),
@@ -515,7 +531,7 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
515531
this.doReload(false);
516532
},
517533

518-
/** @summary when new query entered in the seach field */
534+
/** @summary when new query entered in the search field */
519535
onSearch(oEvt, direct) {
520536

521537
let query = (typeof oEvt == 'string' && direct) ? oEvt : oEvt.getSource().getValue();
@@ -537,7 +553,6 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
537553

538554
/** @summary when click cell on tree table */
539555
onCellClick(oEvent) {
540-
541556
let tt = this.byId("treeTable"),
542557
first = tt.getFirstVisibleRow() || 0,
543558
rowindx = oEvent.getParameters().rowIndex - first,

ui5/geom/controller/GeomViewer.controller.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,8 @@ sap.ui.define(['sap/ui/core/mvc/Controller',
675675
},
676676

677677
onExpandMaster() {
678+
this.byId('geomViewerApp').getAggregation('_navMaster').setWidth('');
679+
678680
const master = this.getView().byId('geomHierarchy').getParent();
679681
master.toggleStyleClass('masterExpanded');
680682
const expanded = master.hasStyleClass('masterExpanded');

ui5/geom/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
}
3535

3636
.masterExpanded {
37-
width: 40% !important;
37+
width: 55% !important;
3838
}
3939
</style>
4040

0 commit comments

Comments
 (0)