Fix for #160
This commit is contained in:
@@ -1,23 +1,13 @@
|
||||
angular.module("umbraco.directives").directive('archetypeCustomView', function ($compile, $http) {
|
||||
var linker = function (scope, element, attrs) {
|
||||
|
||||
var config = scope.archetype.config.archetypeConfig;
|
||||
|
||||
var view = "/App_plugins/Archetype/views/archetype.default.html";
|
||||
if(config.customViewPath) {
|
||||
if(scope.model.config.customViewPath) {
|
||||
view = config.customViewPath;
|
||||
}
|
||||
|
||||
$http.get(view).then(function(data) {
|
||||
|
||||
scope.model = {};
|
||||
scope.model.value = scope.archetype.value;
|
||||
scope.model.config = scope.archetype.config;
|
||||
|
||||
scope.$watch('model.value', function (newValue, oldValue) {
|
||||
scope.archetype.value = newValue;
|
||||
});
|
||||
|
||||
element.html(data.data).show();
|
||||
|
||||
$compile(element.contents())(scope);
|
||||
@@ -27,9 +17,6 @@ angular.module("umbraco.directives").directive('archetypeCustomView', function (
|
||||
return {
|
||||
restrict: "A",
|
||||
replace: true,
|
||||
link: linker,
|
||||
scope: {
|
||||
archetype: "="
|
||||
}
|
||||
link: linker
|
||||
}
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="archetypeEditor ng-class:model.config.customCssClass" ng-controller="Imulus.ArchetypeController">
|
||||
<div class="archetypeEditor ng-class:model.config.customCssClass">
|
||||
<textarea class="archetypeDeveloperModel" ng-show="model.config.developerMode" ng-model="model.value"></textarea>
|
||||
<ul ui-sortable="sortableOptions" ng-model="model.value.fieldsets" ng-show="!showAddButton()">
|
||||
<li ng-repeat="fieldset in model.value.fieldsets">
|
||||
|
||||
@@ -1 +1 @@
|
||||
<div archetype-custom-view archetype="model"></div>
|
||||
<div archetype-custom-view ng-controller="Imulus.ArchetypeController"></div>
|
||||
|
||||
Reference in New Issue
Block a user