rename view to overlayView

This commit is contained in:
Niels Lyngsø
2020-03-02 11:12:04 +01:00
parent f43c0338f9
commit 5b910c178a
4 changed files with 11 additions and 14 deletions

View File

@@ -936,7 +936,7 @@
var elementEditor = {
block: blockModel,
view: "views/common/infiniteeditors/elementeditor/elementeditor.html",
view: blockModel.overlayView || "views/common/infiniteeditors/elementeditor/elementeditor.html",
size: blockModel.overlaySize,
submit: function(model) {
blockModel.content = model.block.content;

View File

@@ -150,7 +150,7 @@
var entry = {
"contentTypeAlias": alias,
"view": null,
"overlayView": null,
"labelTemplate": "",
"settingsElementTypeAlias": null
};
@@ -233,7 +233,7 @@
localizationService.localizeMany(["general_remove", "defaultdialogs_confirmremoveusageof"]).then(function (data) {
overlayService.confirmRemove({
title: data[0],
content: localizationService.tokenReplace(data[1], [entry.view]),
content: localizationService.tokenReplace(data[1], [entry.overlayView]),
close: function () {
overlayService.close();
},
@@ -245,7 +245,7 @@
});
};
vm.removeViewForEntry = function(entry) {
entry.view = null;
entry.overlayView = null;
};
vm.addViewForEntry = function(entry) {
const filePicker = {
@@ -255,13 +255,10 @@
entityType: "file",
isDialog: true,
filter: function (i) {
if (i.name.indexOf(".html") !== -1) {
return true;
}
return (i.name.indexOf(".html") !== -1);
},
select: function (file) {
console.log(file);
entry.view = file.name;
entry.overlayView = file.name;
editorService.close();
},
close: function () {

View File

@@ -36,16 +36,16 @@
<input type="text" ng-model="entry.label" class="text-input"/>
</div>
<div class="umb-table-cell">
<div class="settings-input --hasValue" ng-if="entry.view !== null" >
<div class="settings-input --hasValue" ng-if="entry.overlayView !== null" >
<umb-node-preview icon="'icon-document'" name="entry.view"></umb-node-preview>
<umb-node-preview icon="'icon-document'" name="entry.overlayView"></umb-node-preview>
<div class="cell-actions">
<button type="button" class="btn-reset cell-actions-btn --remove umb-outline" ng-click="vm.requestRemoveViewForEntry(entry)">
<i class="icon icon-wrong"></i>
</button>
</div>
</div>
<button type="button" class="btn-reset settings-input --noValue umb-outline" ng-if="entry.view === null" ng-click="vm.addViewForEntry(entry)">
<button type="button" class="btn-reset settings-input --noValue umb-outline" ng-if="entry.overlayView === null" ng-click="vm.addViewForEntry(entry)">
<localize key="blockEditor_addCustomView">Add custom view</localize>
</button>
</div>

View File

@@ -35,8 +35,8 @@ namespace Umbraco.Web.PropertyEditors
[JsonProperty("settingsElementTypeAlias")]
public string SettingsElementTypeAlias { get; set; }
[JsonProperty("view")]
public string View { get; set; }
[JsonProperty("overlayView")]
public string OverlayView { get; set; }
[JsonProperty("label")]
public string Label { get; set; }