diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
index 76274a4901..ddd98d4b8a 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js
@@ -104,9 +104,7 @@
//with a copy of the contentApps. This is required because each editor renders it's own
//header and content apps section and the content apps contains the view for editing content itself
//and we need to assign a view model to the subView so that it is scoped to the current
- //editor so that split views work. This is a bit hacky but it's required because the content
- //app stuff isn't built to have a scoped model to an editor, it's built to have a single global
- //model but that doesn't work for having split view.
+ //editor so that split views work.
//copy the apps from the main model if not assigned yet to the variant
if (!variant.apps) {
@@ -132,7 +130,7 @@
}
}
- //the assign the variant to a view model to the content app
+ //then assign the variant to a view model to the content app
var contentApp = _.find(variant.apps, function (a) {
return a.alias === "content";
});
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorsubview.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorsubview.js
new file mode 100644
index 0000000000..e8b41529ae
--- /dev/null
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorsubview.js
@@ -0,0 +1,33 @@
+(function () {
+ 'use strict';
+
+ /**
+ * A directive that renders a defined view with a view model and a the whole content model.
+ **/
+ function EditorSubViewDirective() {
+
+ function link(scope, el, attr, ctrl) {
+ //The model can contain: view, viewModel, name, alias, icon
+
+ if (!scope.model.view) {
+ throw "No view defined for the content app";
+ }
+ }
+
+ var directive = {
+ restrict: 'E',
+ replace: true,
+ templateUrl: 'views/components/editor/umb-editor-sub-view.html',
+ scope: {
+ model: "=",
+ content: "="
+ },
+ link: link
+ };
+
+ return directive;
+ }
+
+ angular.module('umbraco.directives').directive('umbEditorSubView', EditorSubViewDirective);
+
+})();
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorsubviews.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorsubviews.directive.js
index ea3c4799cd..7033a03943 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorsubviews.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/editor/umbeditorsubviews.directive.js
@@ -1,6 +1,11 @@
(function () {
'use strict';
+ /**
+ * A directive that just repeats over a list of defined views which are all able to access the same common model.
+ * This is only used in simple cases, whereas media and content use umbEditorSubView (singular) which allows
+ * passing in a view model specific to the view and the entire content model for support if required.
+ **/
function EditorSubViewsDirective() {
function link(scope, el, attr, ctrl) {
diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valsubview.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valsubview.directive.js
index ca571d3954..a65a08d17e 100644
--- a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valsubview.directive.js
+++ b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valsubview.directive.js
@@ -18,7 +18,7 @@
}
var valFormManager = ctrl[1];
- scope.subView.hasError = false;
+ scope.model.hasError = false;
//listen for form validation changes
valFormManager.onValidationStatusChanged(function (evt, args) {
@@ -27,14 +27,14 @@
var subViewContent = el.find(".ng-invalid");
if (subViewContent.length > 0) {
- scope.subView.hasError = true;
+ scope.model.hasError = true;
} else {
- scope.subView.hasError = false;
+ scope.model.hasError = false;
}
}
else {
- scope.subView.hasError = false;
+ scope.model.hasError = false;
}
});
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html
index f8ce725f18..88b5343c1f 100644
--- a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html
+++ b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html
@@ -33,11 +33,11 @@