Merge branch 'dev-v7' into temp-UAASSCRUM-1405

# Conflicts:
#	src/Umbraco.Web/Features/DisabledFeatures.cs
#	src/Umbraco.Web/Features/EnabledFeatures.cs
This commit is contained in:
Shannon
2018-03-14 12:25:37 +11:00
57 changed files with 884 additions and 361 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 KiB

After

Width:  |  Height:  |  Size: 180 KiB

View File

@@ -8,6 +8,8 @@
var evts = [];
var isInfoTab = false;
scope.publishStatus = {};
scope.disableTemplates = Umbraco.Sys.ServerVariables.features.disabledFeatures.disableTemplates;
function onInit() {
@@ -50,7 +52,7 @@
scope.openDocumentType = function (documentType) {
var url = "/settings/documenttypes/edit/" + documentType.id;
$location.path(url);
$location.url(url);
};
scope.updateTemplate = function (templateAlias) {

View File

@@ -10,12 +10,12 @@ function noDirtyCheck() {
require: 'ngModel',
link: function (scope, elm, attrs, ctrl) {
elm.focus(function () {
scope.$watch(function() {
ctrl.$pristine = false;
});
});
var alwaysFalse = {
get: function () { return false; },
set: function () { }
};
Object.defineProperty(ctrl, '$pristine', alwaysFalse);
Object.defineProperty(ctrl, '$dirty', alwaysFalse);
}
};

View File

@@ -267,10 +267,10 @@
// by looking at the key
switch (foundAlias[0]) {
case "umbracoMemberLockedOut":
saveModel.isLockedOut = prop.value.toString() === "1" ? true : false;
saveModel.isLockedOut = prop.value ? (prop.value.toString() === "1" ? true : false) : false;
break;
case "umbracoMemberApproved":
saveModel.isApproved = prop.value.toString() === "1" ? true : false;
saveModel.isApproved = prop.value ? (prop.value.toString() === "1" ? true : false) : true;
break;
case "umbracoMemberComments":
saveModel.comments = prop.value;

View File

@@ -40,6 +40,16 @@
padding: 10px;
}
.umb-contentpicker__min-max-help {
font-size: 13px;
margin-top: 5px;
color: @gray-4;
}
.show-validation .umb-contentpicker__min-max-help {
display: none;
}
.umb-contentpicker small {
&:not(:last-child) {
@@ -109,22 +119,22 @@ ul.color-picker li a {
}
/* pre-value editor */
/*.control-group.color-picker-preval:before {
content: "";
display: inline-block;
vertical-align: middle;
height: 100%;
}*/
/*.control-group.color-picker-preval div.thumbnail {
display: inline-block;
/*.control-group.color-picker-preval:before {
content: "";
display: inline-block;
vertical-align: middle;
}*/
.control-group.color-picker-preval div.color-picker-prediv {
display: inline-block;
height: 100%;
}*/
/*.control-group.color-picker-preval div.thumbnail {
display: inline-block;
vertical-align: middle;
}*/
.control-group.color-picker-preval div.color-picker-prediv {
display: inline-block;
width: 60%;
}
}
.control-group.color-picker-preval pre {
display: inline;
margin-right: 20px;
@@ -136,18 +146,18 @@ ul.color-picker li a {
vertical-align: middle;
}
.control-group.color-picker-preval btn {
.control-group.color-picker-preval btn {
//vertical-align: middle;
}
}
.control-group.color-picker-preval input[type="text"] {
min-width: 40%;
width: 40%;
display: inline-block;
margin-right: 20px;
.control-group.color-picker-preval input[type="text"] {
min-width: 40%;
width: 40%;
display: inline-block;
margin-right: 20px;
margin-top: 1px;
}
}
.control-group.color-picker-preval label {
border: solid @white 1px;
padding: 6px;

View File

@@ -14,7 +14,6 @@
</li>
<li data-element="section-{{section.alias}}" ng-repeat="section in sections | limitTo: maxSections" ng-class="{current: section.alias == currentSection}">
<a href="#/{{section.alias}}"
hotkey="ctrl+alt+{{$index+1}}"
ng-dblclick="sectionDblClick(section)"
ng-click="sectionClick($event, section)"
prevent-default>
@@ -42,8 +41,6 @@
<ul class="sections sections-tray">
<li ng-repeat="section in sections | limitTo: overflowingSections" ng-class="{current: section.alias == currentSection}">
<a href="#/{{section.alias}}"
hotkey="ctrl+alt+{{$index+1+maxSections}}"
hotkey-when-hidden="true"
ng-dblclick="sectionDblClick(section)"
ng-click="sectionClick($event, section)"
prevent-default>

View File

@@ -171,27 +171,25 @@
{{publishStatus.label}}
</umb-badge>
</umb-control-group>
<umb-control-group data-element="node-info-create-date" label="@template_createdDate">
{{node.createDateFormatted}} <localize key="general_by">by</localize> {{ node.owner.name }}
</umb-control-group>
<umb-control-group data-element="node-info-document-type" label="@content_documentType">
<umb-node-preview
style="max-width: 100%; margin-bottom: 0;"
icon="documentType.icon"
name="documentType.name"
allow-open="allowOpen"
on-open="openDocumentType(documentType)">
<umb-node-preview style="max-width: 100%; margin-bottom: 0;"
icon="documentType.icon"
name="documentType.name"
allow-open="allowOpen"
on-open="openDocumentType(documentType)">
</umb-node-preview>
</umb-control-group>
<umb-control-group data-element="node-info-template" label="@template_template">
<select
class="input-block-level"
ng-model="node.template"
ng-options="key as value for (key, value) in availableTemplates"
ng-change="updateTemplate(node.template)">
<umb-control-group ng-if="disableTemplates == false" data-element="node-info-template" label="@template_template">
<select class="input-block-level"
ng-model="node.template"
ng-options="key as value for (key, value) in availableTemplates"
ng-change="updateTemplate(node.template)">
<option value=""><localize key="general_choose">Choose</localize>...</option>
</select>
</umb-control-group>
@@ -200,7 +198,7 @@
<div>{{ node.id }}</div>
<small>{{ node.key }}</small>
</umb-control-group>
</umb-box-content>
</umb-box>
</div>

View File

@@ -30,7 +30,6 @@
ng-model="name"
ng-class="{'name-is-empty': $parent.name===null || $parent.name===''}"
umb-auto-focus
hotkey="ctrl+,"
val-server-field="Name"
required />
</ng-form>

View File

@@ -4,7 +4,7 @@
class="alert alert-block alert-{{notification.type}} umb-notifications__notification animated -half-second fadeIn"
ng-class="{'-no-border -extra-padding': notification.type === 'form'}">
<a class='close -align-right' hotkey="esc" ng-click="removeNotification($index)" prevent-default href>&times;</a>
<a class='close -align-right' ng-click="removeNotification($index)" prevent-default href>&times;</a>
<div ng-if="notification.view">
<div ng-include="notification.view"></div>

View File

@@ -1,5 +1,4 @@
<div data-element="overlay" class="umb-overlay umb-overlay-{{position}}" hotkey="esc" on-outside-click="closeOverLay()">
<div data-element="overlay" class="umb-overlay umb-overlay-{{position}}" on-outside-click="closeOverLay()">
<ng-form class="umb-overlay__form" name="overlayForm" novalidate val-form-manager>
<div data-element="overlay-header" class="umb-overlay-header">

View File

@@ -1,5 +1,5 @@
<ul class="nav nav-tabs umb-nav-tabs">
<li data-element="tab-{{tab.alias}}" ng-class="{'tab-error': tabHasError}" ng-repeat="tab in model" val-tab>
<a data-toggle="tab" hotkey="ctrl+{{$index+1}}" href="#tab{{tab.id}}{{idSuffix}}">{{ tab.label }}</a>
<a data-toggle="tab" href="#tab{{tab.id}}{{idSuffix}}">{{ tab.label }}</a>
</li>
</ul>

View File

@@ -47,7 +47,17 @@
</a>
</div>
<div class="umb-table-cell" ng-repeat="column in itemProperties">
<span title="{{column.header}}: {{item[column.alias]}}">{{item[column.alias]}}</span>
<span title="{{column.header}}: {{item[column.alias]}}">
<div ng-if="!column.isSensitive">
{{item[column.alias]}}
</div>
<em ng-show="column.isSensitive" class="muted">
<localize key="content_isSensitiveValue_short"></localize>
</em>
</span>
</div>
</div>
</div>

View File

@@ -14,18 +14,21 @@ function DocumentTypesCreateController($scope, $location, navigationService, con
creatingFolder: false,
};
var disableTemplates = Umbraco.Sys.ServerVariables.features.disabledFeatures.disableTemplates;
$scope.model.disableTemplates = disableTemplates;
var node = $scope.dialogOptions.currentNode,
localizeCreateFolder = localizationService.localize("defaultdialog_createFolder");
$scope.showCreateFolder = function() {
$scope.showCreateFolder = function () {
$scope.model.creatingFolder = true;
};
$scope.createContainer = function() {
$scope.createContainer = function () {
if (formHelper.submitForm({scope: $scope, formCtrl: this.createFolderForm, statusMessage: localizeCreateFolder})) {
if (formHelper.submitForm({ scope: $scope, formCtrl: this.createFolderForm, statusMessage: localizeCreateFolder })) {
contentTypeResource.createContainer(node.id, $scope.model.folderName).then(function(folderId) {
contentTypeResource.createContainer(node.id, $scope.model.folderName).then(function (folderId) {
navigationService.hideMenu();
@@ -44,7 +47,7 @@ function DocumentTypesCreateController($scope, $location, navigationService, con
var section = appState.getSectionState("currentSection");
}, function(err) {
}, function (err) {
$scope.error = err;
@@ -58,14 +61,17 @@ function DocumentTypesCreateController($scope, $location, navigationService, con
}
};
$scope.createDocType = function() {
$location.search('create', null);
$location.search('notemplate', null);
$location.path("/settings/documenttypes/edit/" + node.id).search("create", "true");
navigationService.hideMenu();
};
// Disabling logic for creating document type with template if disableTemplates is set to true
if (!disableTemplates) {
$scope.createDocType = function () {
$location.search('create', null);
$location.search('notemplate', null);
$location.path("/settings/documenttypes/edit/" + node.id).search("create", "true");
navigationService.hideMenu();
};
}
$scope.createComponent = function() {
$scope.createComponent = function () {
$location.search('create', null);
$location.search('notemplate', null);
$location.path("/settings/documenttypes/edit/" + node.id).search("create", "true").search("notemplate", "true");

View File

@@ -4,7 +4,7 @@
<h5><localize key="create_createUnder">Create an item under</localize> {{currentNode.name}}</h5>
<ul class="umb-actions umb-actions-child">
<li data-element="action-documentType">
<li data-element="action-documentType" ng-hide="model.disableTemplates">
<a href="" ng-click="createDocType()" umb-auto-focus>
<i class="large icon-item-arrangement"></i>
@@ -15,10 +15,14 @@
</a>
</li>
<li data-element="action-documentTypeWithoutTemplate">
<a href="" ng-click="createComponent()">
<i class="large icon-item-arrangement"></i>
<span class="menu-label"><localize key="create_documentTypeWithoutTemplate"></localize></span>
</a>
<a href="" ng-click="createComponent()">
<i class="large icon-item-arrangement"></i>
<span class="menu-label">
<localize ng-if="model.disableTemplates == false" key="create_documentTypeWithoutTemplate"></localize>
<localize ng-if="model.disableTemplates == true" key="content_documentType">Document type></localize>
</span>
</a>
</li>
<li data-element="action-folder" ng-if="model.allowCreateFolder">
<a href="" ng-click="showCreateFolder()">
@@ -33,7 +37,7 @@
<form novalidate name="createFolderForm"
ng-submit="createContainer()"
val-form-manager>
<div ng-show="error">
<h5 class="text-error">{{error.errorMsg}}</h5>
<p class="text-error">{{error.data.message}}</p>

View File

@@ -15,6 +15,36 @@
var localizeSaving = localizationService.localize("general_saving");
var evts = [];
var disableTemplates = Umbraco.Sys.ServerVariables.features.disabledFeatures.disableTemplates;
var buttons = [
{
"name": localizationService.localize("general_design"),
"alias": "design",
"icon": "icon-document-dashed-line",
"view": "views/documenttypes/views/design/design.html",
"active": true
},
{
"name": localizationService.localize("general_listView"),
"alias": "listView",
"icon": "icon-list",
"view": "views/documenttypes/views/listview/listview.html"
},
{
"name": localizationService.localize("general_rights"),
"alias": "permissions",
"icon": "icon-keychain",
"view": "views/documenttypes/views/permissions/permissions.html"
},
{
"name": localizationService.localize("treeHeaders_templates"),
"alias": "templates",
"icon": "icon-layout",
"view": "views/documenttypes/views/templates/templates.html"
}
];
vm.save = save;
vm.currentNode = null;
@@ -23,97 +53,73 @@
vm.page = {};
vm.page.loading = false;
vm.page.saveButtonState = "init";
vm.page.navigation = [
{
"name": localizationService.localize("general_design"),
"alias": "design",
"icon": "icon-document-dashed-line",
"view": "views/documenttypes/views/design/design.html",
"active": true
},
{
"name": localizationService.localize("general_listView"),
"alias": "listView",
"icon": "icon-list",
"view": "views/documenttypes/views/listview/listview.html"
},
{
"name": localizationService.localize("general_rights"),
"alias": "permissions",
"icon": "icon-keychain",
"view": "views/documenttypes/views/permissions/permissions.html"
},
{
"name": localizationService.localize("treeHeaders_templates"),
"alias": "templates",
"icon": "icon-layout",
"view": "views/documenttypes/views/templates/templates.html"
}
];
vm.page.navigation = [];
loadButtons();
vm.page.keyboardShortcutsOverview = [
{
"name": localizationService.localize("main_sections"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_navigateSections"),
"keys": [{ "key": "1" }, { "key": "4" }],
"keyRange": true
}
]
},
{
"name": localizationService.localize("general_design"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_addTab"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
},
{
"description": localizationService.localize("shortcuts_addProperty"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "p" }]
},
{
"description": localizationService.localize("shortcuts_addEditor"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "e" }]
},
{
"description": localizationService.localize("shortcuts_editDataType"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "d" }]
}
]
},
{
"name": localizationService.localize("general_listView"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_toggleListView"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "l" }]
}
]
},
{
"name": localizationService.localize("general_rights"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_toggleAllowAsRoot"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "r" }]
},
{
"description": localizationService.localize("shortcuts_addChildNode"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "c" }]
}
]
},
{
"name": localizationService.localize("treeHeaders_templates"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_addTemplate"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
}
]
}
{
"name": localizationService.localize("main_sections"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_navigateSections"),
"keys": [{ "key": "1" }, { "key": "4" }],
"keyRange": true
}
]
},
{
"name": localizationService.localize("general_design"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_addTab"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
},
{
"description": localizationService.localize("shortcuts_addProperty"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "p" }]
},
{
"description": localizationService.localize("shortcuts_addEditor"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "e" }]
},
{
"description": localizationService.localize("shortcuts_editDataType"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "d" }]
}
]
},
{
"name": localizationService.localize("general_listView"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_toggleListView"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "l" }]
}
]
},
{
"name": localizationService.localize("general_rights"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_toggleAllowAsRoot"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "r" }]
},
{
"description": localizationService.localize("shortcuts_addChildNode"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "c" }]
}
]
},
{
"name": localizationService.localize("treeHeaders_templates"),
"shortcuts": [
{
"description": localizationService.localize("shortcuts_addTemplate"),
"keys": [{ "key": "alt" }, { "key": "shift" }, { "key": "t" }]
}
]
}
];
contentTypeHelper.checkModelsBuilderStatus().then(function (result) {
@@ -144,7 +150,7 @@
vm.page.saveButtonState = "busy";
localizationService.localize("modelsBuilder_buildingModels").then(function (headerValue) {
localizationService.localize("modelsBuilder_waitingMessage").then(function(msgValue) {
localizationService.localize("modelsBuilder_waitingMessage").then(function (msgValue) {
notificationsService.info(headerValue, msgValue);
});
});
@@ -155,26 +161,26 @@
if (!result.lastError) {
//re-check model status
contentTypeHelper.checkModelsBuilderStatus().then(function(statusResult) {
contentTypeHelper.checkModelsBuilderStatus().then(function (statusResult) {
vm.page.modelsBuilder = statusResult;
});
//clear and add success
vm.page.saveButtonState = "init";
localizationService.localize("modelsBuilder_modelsGenerated").then(function(value) {
localizationService.localize("modelsBuilder_modelsGenerated").then(function (value) {
notificationsService.success(value);
});
} else {
vm.page.saveButtonState = "error";
localizationService.localize("modelsBuilder_modelsExceptionInUlog").then(function(value) {
localizationService.localize("modelsBuilder_modelsExceptionInUlog").then(function (value) {
notificationsService.error(value);
});
}
}, function () {
vm.page.saveButtonState = "error";
localizationService.localize("modelsBuilder_modelsGeneratedError").then(function(value) {
localizationService.localize("modelsBuilder_modelsGeneratedError").then(function (value) {
notificationsService.error(value);
});
});
@@ -189,7 +195,7 @@
//we are creating so get an empty data type item
contentTypeResource.getScaffold($routeParams.id)
.then(function(dt) {
.then(function (dt) {
init(dt);
vm.page.loading = false;
});
@@ -207,12 +213,26 @@
});
}
function loadButtons() {
angular.forEach(buttons,
function (val, index) {
if (disableTemplates === true && val.alias === "templates") {
buttons.splice(index, 1);
}
});
vm.page.navigation = buttons;
}
/* ---------- SAVE ---------- */
function save() {
// only save if there is no overlays open
if(overlayHelper.getNumberOfOverlays() === 0) {
if (overlayHelper.getNumberOfOverlays() === 0) {
var deferred = $q.defer();
@@ -233,7 +253,7 @@
// we need to rebind... the IDs that have been created!
rebindCallback: function (origContentType, savedContentType) {
vm.contentType.id = savedContentType.id;
vm.contentType.groups.forEach(function(group) {
vm.contentType.groups.forEach(function (group) {
if (!group.name) return;
var k = 0;
while (k < savedContentType.groups.length && savedContentType.groups[k].name != group.name)
@@ -273,7 +293,7 @@
}
else {
localizationService.localize("speechBubbles_validationFailedHeader").then(function (headerValue) {
localizationService.localize("speechBubbles_validationFailedMessage").then(function(msgValue) {
localizationService.localize("speechBubbles_validationFailedMessage").then(function (msgValue) {
notificationsService.error(headerValue, msgValue);
});
});
@@ -331,7 +351,7 @@
function getDataTypeDetails(property) {
if (property.propertyState !== "init") {
dataTypeResource.getById(property.dataTypeId)
.then(function(dataType) {
.then(function (dataType) {
property.dataTypeIcon = dataType.icon;
property.dataTypeName = dataType.name;
});
@@ -345,7 +365,7 @@
});
}
evts.push(eventsService.on("app.refreshEditor", function(name, error) {
evts.push(eventsService.on("app.refreshEditor", function (name, error) {
loadDocumentType();
}));

View File

@@ -15,7 +15,7 @@ function ColorPickerController($scope) {
$scope.toggleItem = function (color) {
var currentColor = $scope.model.value.hasOwnProperty("value")
var currentColor = ($scope.model.value && $scope.model.value.hasOwnProperty("value"))
? $scope.model.value.value
: $scope.model.value;

View File

@@ -20,7 +20,7 @@
</umb-node-preview>
</div>
<a ng-show="model.config.multiPicker === true || renderModel.length === 0"
<a ng-show="model.config.multiPicker === true && renderModel.length < model.config.maxNumber || renderModel.length === 0 || !model.config.maxNumber"
class="umb-node-preview-add"
href=""
ng-click="openContentPicker()"
@@ -28,6 +28,39 @@
<localize key="general_add">Add</localize>
</a>
<div class="umb-contentpicker__min-max-help">
<!-- Both min and max items -->
<span ng-if="model.config.minNumber && model.config.maxNumber && model.config.minNumber !== model.config.maxNumber">
<span ng-if="renderModel.length < model.config.maxNumber">Add between {{model.config.minNumber}} and {{model.config.maxNumber}} items</span>
<span ng-if="renderModel.length > model.config.maxNumber">
<localize key="validation_maxCount">You can only have</localize> {{model.config.maxNumber}} <localize key="validation_itemsSelected"> items selected</localize>
</span>
</span>
<!-- Equal min and max -->
<span ng-if="model.config.minNumber && model.config.maxNumber && model.config.minNumber === model.config.maxNumber">
<span ng-if="renderModel.length < model.config.maxNumber">Add {{model.config.minNumber - renderModel.length}} item(s)</span>
<span ng-if="renderModel.length > model.config.maxNumber">
<localize key="validation_maxCount">You can only have</localize> {{model.config.maxNumber}} <localize key="validation_itemsSelected"> items selected</localize>
</span>
</span>
<!-- Only max -->
<span ng-if="!model.config.minNumber && model.config.maxNumber">
<span ng-if="renderModel.length < model.config.maxNumber">Add up to {{model.config.maxNumber}} items</span>
<span ng-if="renderModel.length > model.config.maxNumber">
<localize key="validation_maxCount">You can only have</localize> {{model.config.maxNumber}} <localize key="validation_itemsSelected">items selected</localize>
</span>
</span>
<!-- Only min -->
<span ng-if="model.config.minNumber && !model.config.maxNumber && renderModel.length < model.config.minNumber">
Add at least {{model.config.minNumber}} item(s)
</span>
</div>
<!--These are here because we need ng-form fields to validate against-->
<input type="hidden" name="minCount" ng-model="renderModel" />
<input type="hidden" name="maxCount" ng-model="renderModel" />

View File

@@ -130,6 +130,9 @@ function fileUploadController($scope, $element, $compile, imageHelper, fileManag
// in the description of this controller, it states that this value isn't actually used for persistence,
// but we need to set it so that the editor and the server can detect that it's been changed, and it is used for validation.
$scope.model.value = { selectedFiles: newVal.trimEnd(",") };
//need to explicity setDirty here as file upload field can't track dirty & we can't use the fileCount (hidden field/model)
$scope.propertyForm.$setDirty();
});
});

View File

@@ -31,6 +31,6 @@
</ul>
</div>
<input type="hidden" name="fileCount" ng-model="files.length" val-property-validator="validateMandatory"/>
<input type="hidden" name="fileCount" ng-model="files.length" val-property-validator="validateMandatory" no-dirty-check />
</div>

View File

@@ -30,15 +30,14 @@
vm.dragLeave = dragLeave;
vm.onFilesQueue = onFilesQueue;
vm.onUploadComplete = onUploadComplete;
markAsSensitive();
function activate() {
if ($scope.entityType === 'media') {
mediaTypeHelper.getAllowedImagetypes(vm.nodeId).then(function (types) {
vm.acceptedMediatypes = types;
});
}
}
function selectAll($event) {
@@ -87,6 +86,27 @@
$scope.getContent($scope.contentId);
}
function markAsSensitive() {
angular.forEach($scope.options.includeProperties, function (option) {
option.isSensitive = false;
angular.forEach($scope.items,
function (item) {
angular.forEach(item.properties,
function (property) {
if (option.alias === property.alias) {
option.isSensitive = property.isSensitive;
}
});
});
});
}
activate();
}

View File

@@ -46,6 +46,7 @@ function MarkdownEditorController($scope, $element, assetsService, dialogService
// init the md editor after this digest because the DOM needs to be ready first
// so run the init on a timeout
$timeout(function () {
$scope.markdownEditorInitComplete = false;
var converter2 = new Markdown.Converter();
var editor2 = new Markdown.Editor(converter2, "-" + $scope.model.alias);
editor2.run();
@@ -59,7 +60,12 @@ function MarkdownEditorController($scope, $element, assetsService, dialogService
editor2.hooks.set("onPreviewRefresh", function () {
// We must manually update the model as there is no way to hook into the markdown editor events without exstensive edits to the library.
if ($scope.model.value !== $("textarea", $element).val()) {
angularHelper.getCurrentForm($scope).$setDirty();
if ($scope.markdownEditorInitComplete) {
//only set dirty after init load to avoid "unsaved" dialogue when we don't want it
angularHelper.getCurrentForm($scope).$setDirty();
} else {
$scope.markdownEditorInitComplete = true;
}
$scope.model.value = $("textarea", $element).val();
}
});