Infolog: Move timestamper & encrypt buttons into tabs using slot and parentID

Also, fix parentId was inconsistently applied
This commit is contained in:
nathan 2022-09-08 13:14:55 -06:00
parent f85de279c6
commit 9db38979ef
3 changed files with 54 additions and 51 deletions

View File

@ -144,7 +144,7 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
* Widget ID of another node to insert this node into instead of the normal location * Widget ID of another node to insert this node into instead of the normal location
* This isn't a normal property... * This isn't a normal property...
*/ */
parentId: {type: String}, parentId: {type: String, noAccessor: true},
/** /**
* Tooltip which is shown for this element on hover * Tooltip which is shown for this element on hover
@ -911,15 +911,27 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
*/ */
set parentId(parent : string | Element) set parentId(parent : string | Element)
{ {
if(typeof parent === "string") this.__parentId = parent;
this.updateComplete.then(() =>
{ {
parent = document.querySelector("#" + parent); if(!this.__parentId)
} {
if(parent) return;
{ }
parent.append(<Node><unknown>this);
this._parent_node = parent; let parent = document.querySelector("#" + this.__parentId) || this.__parentId;
} if(parent && parent instanceof Element)
{
parent.append(<Node><unknown>this);
this._parent_node = parent;
}
});
}
get parentId()
{
return this.__parentId;
} }
setParent(new_parent : Et2WidgetClass | et2_widget) setParent(new_parent : Et2WidgetClass | et2_widget)

View File

@ -43,51 +43,36 @@ tr.infolog_rowHasParent > td:first-child {
.et2_nextmatch .egwGridView_grid tr td div.et2_vbox .infoDes a{ .et2_nextmatch .egwGridView_grid tr td div.et2_vbox .infoDes a{
display: inline-table; display: inline-table;
} }
/* break in words if necessary for description */ /* break in words if necessary for description */
#infolog-index_nm div.infoDes > span{ #infolog-index_nm div.infoDes > span {
overflow-wrap: break-word; overflow-wrap: break-word;
} }
/* Put line break for the first column*/ /* Put line break for the first column*/
#infolog-index .egwGridView_grid .et2_hbox.et2_box_widget.infolog_CompletedClmn { #infolog-index .egwGridView_grid .et2_hbox.et2_box_widget.infolog_CompletedClmn {
white-space: normal; white-space: normal;
} }
button.infologExtraButton { /* Right-align extra buttons in tab */
background-position: center; .infologExtraButton {
background-size: 16px; margin-left: auto;
padding: 0px;
width: 24px;
height: 24px;
}
button.infologExtraButton:hover {
background-size: 16px;
} }
#infolog-edit .et2_toolbar { .infologExtraButton ~ .infologExtraButton {
position: relative; margin: 0;
}
.tab_toolbar {
position: absolute;
top: 6px;
right: 0;
z-index: 10000; /* otherwise et2-tabs gets our clicks! */
}
.tab_toolbar > button, .tab_toolbar > et2-button {
margin: 0px;
}
td.infologTimestamp {
position: relative;
} }
div#infolog-edit_infolog-edit-description { div#infolog-edit_infolog-edit-description {
height: 100%; height: 100%;
} }
div#infolog-edit_infolog-edit-description iframe {height: calc(100% - 1em) !important;}
div#infolog-edit_infolog-edit-description iframe {
height: calc(100% - 1em) !important;
}
#infolog-edit_info_responsible + .chzn-container .chzn-results { #infolog-edit_info_responsible + .chzn-container .chzn-results {
max-height: 150px; max-height: 150px;
} }
#infolog-index #infolog-index_nm .egwGridView_scrollarea table.egwGridView_grid ul.et2_link_string li.et2_link { #infolog-index #infolog-index_nm .egwGridView_scrollarea table.egwGridView_grid ul.et2_link_string li.et2_link {

View File

@ -183,9 +183,15 @@
<row class="et2_toolbar"> <row class="et2_toolbar">
<description id="spacer" span="5"/> <description id="spacer" span="5"/>
<hbox class="tab_toolbar"> <hbox class="tab_toolbar">
<timestamper statustext="Insert timestamp into description field" id="timestamp" class="infologExtraButton infologTimestamp" target="info_des"/>
<buttononly statustext="Encrypt description" id="encrypt" class="infologExtraButton infologEncrypt" background_image="1" image="lock" onclick="app.infolog.toggleEncrypt"/> <timestamper parentId="infolog-edit_tabs" slot="nav"
</hbox> statustext="Insert timestamp into description field" id="timestamp"
class="infologExtraButton infologTimestamp" target="info_des"/>
<buttononly parentId="infolog-edit_tabs" slot="nav" statustext="Encrypt description"
id="encrypt"
class="infologExtraButton infologEncrypt" background_image="1" image="lock"
onclick="app.infolog.toggleEncrypt"/>
</hbox>
</row> </row>
<row> <row>
<tabbox id="tabs" span="all" width="100%" tab_height="350px"> <tabbox id="tabs" span="all" width="100%" tab_height="350px">
@ -199,14 +205,14 @@
</tabs> </tabs>
<tabpanels> <tabpanels>
<template id="infolog.edit.description"/> <template id="infolog.edit.description"/>
<template id="infolog.edit.details"/> <template id="infolog.edit.details"/>
<template id="infolog.edit.links"/> <template id="infolog.edit.links"/>
<template id="infolog.edit.project"/> <template id="infolog.edit.project"/>
<template id="infolog.edit.customfields"/> <template id="infolog.edit.customfields"/>
<template id="infolog.edit.history"/> <template id="infolog.edit.history"/>
</tabpanels> </tabpanels>
</tabbox> </tabbox>
</row> </row>
<row class="dialogOperators"> <row class="dialogOperators">
<description value="Status" for="info_status"/> <description value="Status" for="info_status"/>
<select class="et2_fullWidth" statustext="@status_help" id="info_status" onchange="app.infolog.statusChanged"/> <select class="et2_fullWidth" statustext="@status_help" id="info_status" onchange="app.infolog.statusChanged"/>