diff --git a/.gitignore b/.gitignore index aab6533..8c1afc1 100644 --- a/.gitignore +++ b/.gitignore @@ -62,4 +62,5 @@ VersionInfo.cs .builds .svn .hg -.hgignore \ No newline at end of file +.hgignore +app/Umbraco/.vs/config/applicationhost.config \ No newline at end of file diff --git a/app/controllers/config.controller.js b/app/controllers/config.controller.js index b8437a2..715b3e1 100644 --- a/app/controllers/config.controller.js +++ b/app/controllers/config.controller.js @@ -47,6 +47,12 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio } }; + // added to track loaded fieldsets + $scope.loadedFieldsets = []; + $scope.isLoaded = function (fieldset) { + return $scope.loadedFieldsets.indexOf(fieldset) >= 0; + } + //function that determines how to manage expanding/collapsing fieldsets $scope.focusFieldset = function(fieldset){ var iniState; @@ -60,6 +66,7 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio if($scope.archetypeConfigRenderModel.fieldsets.length == 1 && fieldset.remove == false) { fieldset.collapse = false; + $scope.loadedFieldsets.push(fieldset); return; } @@ -70,12 +77,14 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio else { fieldset.collapse = false; + $scope.loadedFieldsets.push(fieldset); } }); if(iniState) { fieldset.collapse = !iniState; + $scope.loadedFieldsets.push(fieldset); } } @@ -123,27 +132,20 @@ angular.module("umbraco").controller("Imulus.ArchetypeConfigController", functio //watch for changes $scope.$watch('archetypeConfigRenderModel', function (v) { - //console.log(v); if (typeof v === 'string') { $scope.archetypeConfigRenderModel = JSON.parse(v); $scope.archetypeConfigRenderModel.toString = stringify; } }); - $scope.autoPopulateAlias = function(s) { - var modelType = s.hasOwnProperty('fieldset') ? 'fieldset' : 'property'; - var modelProperty = s[modelType]; - - if (!modelProperty.aliasIsDirty) { + $scope.autoPopulateAlias = function (modelProperty) { + if (modelProperty && !modelProperty.aliasIsDirty) { modelProperty.alias = modelProperty.label.toUmbracoAlias(); } } - $scope.markAliasDirty = function(s) { - var modelType = s.hasOwnProperty('fieldset') ? 'fieldset' : 'property'; - var modelProperty = s[modelType]; - - if (!modelProperty.aliasIsDirty) { + $scope.markAliasDirty = function (modelProperty) { + if (modelProperty && !modelProperty.aliasIsDirty) { modelProperty.aliasIsDirty = true;; } } diff --git a/app/views/archetype.config.html b/app/views/archetype.config.html index 224bb0b..bc5755e 100644 --- a/app/views/archetype.config.html +++ b/app/views/archetype.config.html @@ -12,14 +12,14 @@
{{fieldset.label}}
-
+
- +
- +
@@ -50,11 +50,11 @@
- +
- +