fix some linkpicker bugs
This commit is contained in:
@@ -84,13 +84,20 @@
|
||||
value: x.name
|
||||
};
|
||||
});
|
||||
this.area = this.areas[0];
|
||||
this.current = this.area.alias;
|
||||
|
||||
this.link = JSON.parse(JSON.stringify(this.model || this.template));
|
||||
this.link.area = this.current;
|
||||
|
||||
console.info(JSON.parse(JSON.stringify(this.link)));
|
||||
if (this.model && this.model.area && this.areas.find(x => x.alias === this.model.area))
|
||||
{
|
||||
this.area = this.areas.find(x => x.alias === this.model.area);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.area = this.areas[0];
|
||||
}
|
||||
|
||||
this.current = this.area.alias;
|
||||
this.link.area = this.current;
|
||||
|
||||
setTimeout(() => this.opened = true, 300);
|
||||
},
|
||||
@@ -105,6 +112,7 @@
|
||||
|
||||
onSave()
|
||||
{
|
||||
this.link.area = this.current;
|
||||
this.config.confirm(this.link);
|
||||
},
|
||||
|
||||
@@ -133,6 +141,7 @@
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow-short);
|
||||
font-weight: bold;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.ui-linkpicker-overlay-area .ui-native-select select
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
position: relative;
|
||||
padding: 0 32px;
|
||||
|
||||
&.has-icon
|
||||
{
|
||||
grid-template-columns: 32px 1fr 32px;
|
||||
}
|
||||
|
||||
&:hover, &.is-selected
|
||||
{
|
||||
background: var(--color-tree-selected);
|
||||
@@ -29,7 +34,7 @@
|
||||
position: relative;
|
||||
top: -2px;
|
||||
color: var(--color-text-dim);
|
||||
justify-self: center;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.ui-list-item-image
|
||||
|
||||
@@ -13,12 +13,12 @@ namespace zero.Web.Controllers
|
||||
{
|
||||
public class LinksController : BackofficeController
|
||||
{
|
||||
IZeroStore Store;
|
||||
IZeroDocumentSession Session;
|
||||
ILinks Links;
|
||||
|
||||
public LinksController(IZeroStore store, ILinks links)
|
||||
public LinksController(IZeroDocumentSession session, ILinks links)
|
||||
{
|
||||
Store = store;
|
||||
Session = session;
|
||||
Links = links;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace zero.Web.Controllers
|
||||
public async Task<IList<PreviewModel>> GetPreviews([FromBody] List<Link> links)
|
||||
{
|
||||
IList<PreviewModel> previews = new List<PreviewModel>();
|
||||
using IAsyncDocumentSession session = Store.OpenAsyncSession();
|
||||
|
||||
foreach (Link link in links)
|
||||
{
|
||||
@@ -35,7 +34,7 @@ namespace zero.Web.Controllers
|
||||
|
||||
if (provider != null)
|
||||
{
|
||||
model = await provider.Preview(session, link);
|
||||
model = await provider.Preview(Session, link);
|
||||
}
|
||||
|
||||
previews.Add(model ?? new PreviewModel()
|
||||
|
||||
Reference in New Issue
Block a user