From e640a9b4f47b40f8830862437123ab065d25cff5 Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Mon, 14 Dec 2015 09:53:01 -0500 Subject: [PATCH 1/3] This depends on a core PR. --- app/controllers/controller.js | 4 ++-- app/directives/archetypeproperty.js | 14 ++++++++------ app/directives/archetypesubmitwatcher.js | 3 ++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/controllers/controller.js b/app/controllers/controller.js index 264ea27..1af7336 100644 --- a/app/controllers/controller.js +++ b/app/controllers/controller.js @@ -468,7 +468,7 @@ angular.module("umbraco").controller("Imulus.ArchetypeController", function ($sc $scope.activeSubmitWatcher++; return $scope.activeSubmitWatcher; } - $scope.submitWatcherOnSubmit = function () { - $scope.$broadcast("archetypeFormSubmitting"); + $scope.submitWatcherOnSubmit = function (args) { + $scope.$broadcast("archetypeFormSubmitting", args); } }); diff --git a/app/directives/archetypeproperty.js b/app/directives/archetypeproperty.js index 58430f3..f5a2ab9 100644 --- a/app/directives/archetypeproperty.js +++ b/app/directives/archetypeproperty.js @@ -115,14 +115,16 @@ angular.module("umbraco.directives").directive('archetypeProperty', function ($c }); scope.$on('archetypeFormSubmitting', function (ev, args) { - // validate all fieldset properties - _.each(scope.fieldset.properties, function (property) { - archetypeService.validateProperty(scope.fieldset, property, configFieldsetModel); - }); + if(args.action !== 'save') { + // validate all fieldset properties + _.each(scope.fieldset.properties, function (property) { + archetypeService.validateProperty(scope.fieldset, property, configFieldsetModel); + }); - var validationKey = "validation-f" + scope.fieldsetIndex; + var validationKey = "validation-f" + scope.fieldsetIndex; - ngModelCtrl.$setValidity(validationKey, scope.fieldset.isValid); + ngModelCtrl.$setValidity(validationKey, scope.fieldset.isValid); + } // did the value change (if it did, it most likely did so during the "formSubmitting" event) var property = archetypeService.getFieldsetProperty(scope); diff --git a/app/directives/archetypesubmitwatcher.js b/app/directives/archetypesubmitwatcher.js index d2b06c7..75b4ac0 100644 --- a/app/directives/archetypesubmitwatcher.js +++ b/app/directives/archetypesubmitwatcher.js @@ -3,9 +3,10 @@ angular.module("umbraco.directives").directive('archetypeSubmitWatcher', functio // call the load callback on scope to obtain the ID of this submit watcher var id = scope.loadCallback(); scope.$on("formSubmitting", function (ev, args) { + // on the "formSubmitting" event, call the submit callback on scope to notify the Archetype controller to do it's magic if (id == scope.activeSubmitWatcher) { - scope.submitCallback(); + scope.submitCallback(args); } }); } From b7875dd8505300b9206605f46b9d2d6aec8398b4 Mon Sep 17 00:00:00 2001 From: Greg Fyans Date: Tue, 15 Mar 2016 10:28:14 +0000 Subject: [PATCH 2/3] Added native label for RJP.MultiUrlPicker data type --- app/services/archetypeLabelService.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/services/archetypeLabelService.js b/app/services/archetypeLabelService.js index 91f8b72..f33760c 100644 --- a/app/services/archetypeLabelService.js +++ b/app/services/archetypeLabelService.js @@ -31,6 +31,8 @@ angular.module('umbraco.services').factory('archetypeLabelService', function (ar return coreMediaPicker(value, scope, datatype); case "Umbraco.DropDown": return coreDropdown(value, scope, datatype); + case "RJP.MultiUrlPicker": + return rjpMultiUrlPicker(value, scope, {}); default: return ""; } @@ -149,6 +151,18 @@ angular.module('umbraco.services').factory('archetypeLabelService', function (ar return strippedText.substring(0, args.contentLength) + suffix; } + function rjpMultiUrlPicker(values, scope, args) { + var names = []; + + _.each(values, function (value) { + if (value.name) { + names.push(value.name); + } + }); + + return names.join(", "); + } + return { getFieldsetTitle: function(scope, fieldsetConfigModel, fieldsetIndex) { From 4eb901fbba964765b2997e659157662853152d11 Mon Sep 17 00:00:00 2001 From: kgiszewski Date: Tue, 15 Mar 2016 10:04:59 -0400 Subject: [PATCH 3/3] Fix #318 --- app/less/archetype.less | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/app/less/archetype.less b/app/less/archetype.less index a3fddbe..76776e6 100644 --- a/app/less/archetype.less +++ b/app/less/archetype.less @@ -362,8 +362,10 @@ .archetypeFieldsetOption { margin-bottom: 15px; + margin-right: 15px; input[type=text]{ - max-width: 300px; + max-width: 100%; + width: 100%; } } @@ -374,15 +376,20 @@ height: 130px; } - .archetypeOptions label{ - width: 400px; + .archetypeOptions { + .btn { + margin-bottom: 5px; + } + + label{ + width: 400px; + } } .archetypePropertiesWrapper { border: 1px solid #ddd; padding: 8px; margin: -40px 10px 10px 140px; - max-width: 475px; ul { padding: 0; @@ -395,12 +402,13 @@ background-color: #eee; input[type=text] { - max-width: 190px; - width: auto; + max-width: 100%; + width: 100%; } select { - max-width: 160px; + max-width: 100%; + width: 100%; } } @@ -413,6 +421,10 @@ label { width: 100%; } + + input[type=text] { + width: 100%; + } input[type=checkbox] { margin-top: 0; @@ -460,8 +472,10 @@ .archetypePropertyCollapser { margin-top: 10px; + div { margin-bottom: 10px; + margin-right: 15px; } }