live editing ability
This commit is contained in:
+8
@@ -7,6 +7,14 @@ angular.module("umbraco")
|
||||
vm.content = $scope.model.content;
|
||||
vm.settings = $scope.model.settings;
|
||||
|
||||
localizationService.localizeMany([
|
||||
$scope.model.liveEditing ? "prompt_discardChanges" : "general_close",
|
||||
$scope.model.liveEditing ? "buttons_confirmActionConfirm" : "buttons_submitChanges"
|
||||
]).then(function (data) {
|
||||
vm.closeLabel = data[0];
|
||||
vm.submitLabel = data[1];
|
||||
});
|
||||
|
||||
vm.model = $scope.model;
|
||||
|
||||
vm.tabs = [];
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@
|
||||
<umb-button
|
||||
action="vm.close()"
|
||||
button-style="link"
|
||||
label-key="general_close"
|
||||
label="{{vm.closeLabel}}"
|
||||
type="button">
|
||||
</umb-button>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
action="vm.submitAndClose()"
|
||||
button-style="primary"
|
||||
state="submitButtonState"
|
||||
label-key="buttons_submitChanges"
|
||||
label="{{vm.submitLabel}}"
|
||||
type="button">
|
||||
</umb-button>
|
||||
|
||||
|
||||
+22
-4
@@ -37,13 +37,13 @@
|
||||
var deleteAllBlocksAction;
|
||||
|
||||
var inlineEditing = false;
|
||||
var liveEditing = true;
|
||||
|
||||
var vm = this;
|
||||
|
||||
vm.loading = true;
|
||||
vm.currentBlockInFocus = null;
|
||||
vm.setBlockFocus = function(block) {
|
||||
console.log("setBlockFocus", block.label)
|
||||
if(vm.currentBlockInFocus !== null) {
|
||||
vm.currentBlockInFocus.focus = false;
|
||||
}
|
||||
@@ -69,6 +69,7 @@
|
||||
vm.$onInit = function() {
|
||||
|
||||
inlineEditing = vm.model.config.useInlineEditingAsDefault;
|
||||
liveEditing = vm.model.config.useLiveEditing;
|
||||
|
||||
vm.validationLimit = vm.model.config.validationLimit;
|
||||
|
||||
@@ -246,22 +247,39 @@
|
||||
content: blockContentClone,
|
||||
hideContent: hideContent,
|
||||
openSettings: openSettings === true,
|
||||
liveEditing: liveEditing,
|
||||
settings: blockSettingsClone,
|
||||
title: blockObject.label,
|
||||
view: "views/common/infiniteeditors/blockeditor/blockeditor.html",
|
||||
size: blockObject.config.editorSize || "medium",
|
||||
submit: function(blockEditorModel) {
|
||||
|
||||
blockObject.retriveValuesFrom(blockEditorModel.content, blockEditorModel.settings)
|
||||
|
||||
blockEditorModel.close();
|
||||
if (liveEditing === false) {
|
||||
// transfer values when submitting in none-liveediting mode.
|
||||
blockObject.retriveValuesFrom(blockEditorModel.content, blockEditorModel.settings)
|
||||
}
|
||||
|
||||
blockObject.active = false;
|
||||
editorService.close();
|
||||
},
|
||||
close: function() {
|
||||
|
||||
if (liveEditing === true) {
|
||||
// revert values when closing in liveediting mode.
|
||||
blockObject.retriveValuesFrom(blockContentClone, blockSettingsClone)
|
||||
}
|
||||
|
||||
blockObject.active = false;
|
||||
editorService.close();
|
||||
}
|
||||
};
|
||||
|
||||
if (liveEditing === true) {
|
||||
blockEditorModel.content = blockObject.content;
|
||||
} else {
|
||||
blockEditorModel.content = blockContentClone;
|
||||
}
|
||||
|
||||
// open property settings editor
|
||||
editorService.open(blockEditorModel);
|
||||
}
|
||||
|
||||
@@ -58,6 +58,9 @@ namespace Umbraco.Web.PropertyEditors
|
||||
public int? Max { get; set; }
|
||||
}
|
||||
|
||||
[ConfigurationField("useLiveEditing", "Live editing mode", "boolean", Description = "Live editing in editor overlays for live updated custom views.")]
|
||||
public bool UseLiveEditing { get; set; }
|
||||
|
||||
[ConfigurationField("useInlineEditingAsDefault", "Inline editing mode", "boolean", Description = "Use the inline editor as the default block view.")]
|
||||
public bool UseInlineEditingAsDefault { get; set; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user