mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
Link fixes
- Fix links added to not yet saved entries were not displayed in link lists - Adjust LinkList column sizes
This commit is contained in:
parent
485fa5e857
commit
9942ec9f08
@ -285,6 +285,11 @@ export class Et2Link extends ExposeMixin<Et2Widget>(Et2Widget(LitElement)) imple
|
||||
|
||||
_handleClick(_ev : MouseEvent) : boolean
|
||||
{
|
||||
// If we don't have app & entry_id, nothing we can do
|
||||
if(!this.app || !this.entry_id || typeof this.entry_id !== "string")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// If super didn't handle it (returns false), just use egw.open()
|
||||
if(super._handleClick(_ev))
|
||||
{
|
||||
|
@ -226,10 +226,14 @@ export class Et2LinkString extends Et2Widget(LitElement) implements et2_IDetache
|
||||
* Starts the request for link list to the server
|
||||
*
|
||||
* Called internally to fetch the list. May be called externally to trigger a refresh if a link is added.
|
||||
* @protected
|
||||
*
|
||||
*/
|
||||
public get_links()
|
||||
public get_links(not_saved_links? : LinkInfo[])
|
||||
{
|
||||
if(typeof not_saved_links === "undefined")
|
||||
{
|
||||
not_saved_links = [];
|
||||
}
|
||||
let _value = {
|
||||
to_app: this.application,
|
||||
to_id: this.entry_id,
|
||||
@ -245,7 +249,7 @@ export class Et2LinkString extends Et2Widget(LitElement) implements et2_IDetache
|
||||
this._loadingPromise = <Promise<LinkInfo[]>>(this.egw().jsonq('EGroupware\\Api\\Etemplate\\Widget\\Link::ajax_link_list', [_value]))
|
||||
.then(_value =>
|
||||
{
|
||||
this._addLinks(_value);
|
||||
this._addLinks(not_saved_links.concat(_value));
|
||||
this._loadingPromise = null;
|
||||
})
|
||||
}
|
||||
|
@ -446,8 +446,6 @@ export class et2_link_to extends et2_inputWidget
|
||||
},
|
||||
this, et2_link_list
|
||||
);
|
||||
// Update any neighbouring link lists
|
||||
(<Et2LinkList><unknown>(<et2_DOMWidget>this.getParent()).getDOMNode().querySelector('et2-link-list'))?.get_links();
|
||||
|
||||
// If there's an array of data (entry is not yet saved), updating the list will
|
||||
// not work, so add them in explicitly.
|
||||
@ -476,6 +474,8 @@ export class et2_link_to extends et2_inputWidget
|
||||
}
|
||||
}
|
||||
}
|
||||
// Update any neighbouring link lists
|
||||
(<Et2LinkList><unknown>(<et2_DOMWidget>this.getParent()).getDOMNode().querySelector('et2-link-list'))?.get_links(Object.values(success));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1290,6 +1290,7 @@ ul.et2_link_string {
|
||||
|
||||
et2-link-list et2-link {
|
||||
color: initial;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
et2-link-list et2-link:hover {
|
||||
|
Loading…
Reference in New Issue
Block a user