From 893ca14859586425429271117a6f34279bd62406 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Thu, 28 Jan 2016 01:01:06 +0100 Subject: [PATCH 1/9] Config for max items --- .../relatedlinks/relatedlinks.controller.js | 28 +++++++++- .../relatedlinks/relatedlinks.html | 52 +++++++++---------- .../RelatedLinksPropertyEditor.cs | 10 ++++ 3 files changed, 60 insertions(+), 30 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index 26d9768c29..0504378434 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -5,6 +5,8 @@ if (!$scope.model.value) { $scope.model.value = []; } + + $scope.maxNumber = isNumeric($scope.model.config.maxNumber) && $scope.model.config.maxNumber !== 0 ? $scope.model.config.maxNumber : Number.MAX_VALUE; $scope.newCaption = ''; $scope.newLink = 'http://'; @@ -141,9 +143,22 @@ $scope.model.value[index + direction] = temp; }; + //helper for determining if a user can add items + $scope.canAdd = function () { + return $scope.model.config.maxNumber > countVisible(); + } + + //helper that returns if an item can be sorted + $scope.canSort = function () { + return countVisible() > 1; + } + $scope.sortableOptions = { - containment: 'parent', + axis: 'y', + handle: '.handle', cursor: 'move', + cancel: '.no-drag', + containment: 'parent', helper: function (e, ui) { // When sorting , the cells collapse. This helper fixes that: http://www.foliotek.com/devblog/make-table-rows-sortable-using-jquery-ui-sortable/ ui.children().each(function () { @@ -151,7 +166,7 @@ }); return ui; }, - items: '> tr', + items: '> tr:not(.unsortable)', tolerance: 'pointer', update: function (e, ui) { // Get the new and old index for the moved element (using the URL as the identifier) @@ -166,6 +181,15 @@ } }; + //helper to count what is visible + function countVisible() { + return $scope.model.value.length; + } + + function isNumeric(n) { + return !isNaN(parseFloat(n)) && isFinite(n); + } + function getElementIndexByUrl(url) { for (var i = 0; i < $scope.model.value.length; i++) { if ($scope.model.value[i].link == url) { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index a5eae94491..126982267f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -11,8 +11,8 @@ - - + + {{link.caption}} @@ -20,9 +20,7 @@
{{link.link}} - - - +
@@ -41,40 +39,38 @@ -
-
+
- - - - - + + + + - - - - -
- -
- + + + + +
+ +
+ @@ -86,4 +82,4 @@ position="right"> -
+
\ No newline at end of file diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs index 3009b39518..6001d9c54e 100644 --- a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs @@ -11,5 +11,15 @@ namespace Umbraco.Web.PropertyEditors [PropertyEditor(Constants.PropertyEditors.RelatedLinksAlias, "Related links", "relatedlinks", ValueType ="JSON", Icon="icon-thumbnail-list", Group="pickers")] public class RelatedLinksPropertyEditor : PropertyEditor { + //protected override PreValueEditor CreatePreValueEditor() + //{ + // return new RelatedLinksPreValueEditor(); + //} + + //internal class RelatedLinksPreValueEditor : PreValueEditor + //{ + // [PreValueField("maxNumber", "Maximum number of items", "number")] + // public int MaxNumber { get; set; } + //} } } From 7cf4c33d1541e1ad8536c14de30f78d9d4621120 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Mon, 1 Feb 2016 01:52:51 +0100 Subject: [PATCH 2/9] Fix max number in config and other adjustments --- .../src/less/listview.less | 3 ++- .../src/less/property-editors.less | 16 +++++++++++++++- .../relatedlinks/relatedlinks.controller.js | 4 ++-- .../relatedlinks/relatedlinks.html | 10 +++++----- .../RelatedLinksPropertyEditor.cs | 18 +++++++++--------- 5 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/listview.less b/src/Umbraco.Web.UI.Client/src/less/listview.less index b6efa9567f..87d5f9a5e2 100644 --- a/src/Umbraco.Web.UI.Client/src/less/listview.less +++ b/src/Umbraco.Web.UI.Client/src/less/listview.less @@ -243,7 +243,8 @@ background-color: @grayLighter } -.table-striped tbody i:hover { +/* don't hide all icons, e.g. for a sortable handle */ +.table-striped tbody i:not(.handle):hover { display: none !important } diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index b3cb034596..5033dacb2d 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -620,7 +620,21 @@ ul.color-picker li a { } // -// tags +// Related links +// -------------------------------------------------- +.umb-relatedlinks table > tr > td { word-wrap:break-word; word-break: break-all; } +.umb-relatedlinks .handle { cursor:move; } +.umb-relatedlinks table > tbody > tr.unsortable .handle { cursor:default; } + +/* sortable placeholder */ +.umb-relatedlinks .sortable-placeholder { + //background-color: #fff; + margin-bottom: 47px; +} + + +// +// Tags // -------------------------------------------------- .umb-tags{border: @grayLighter solid 1px; padding: 10px; font-size: 13px; text-shadow: none;} .umb-tags .tag{cursor: pointer; margin: 7px; padding: 7px; background: @blue} diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index 0504378434..af7ea0cb24 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -6,7 +6,7 @@ $scope.model.value = []; } - $scope.maxNumber = isNumeric($scope.model.config.maxNumber) && $scope.model.config.maxNumber !== 0 ? $scope.model.config.maxNumber : Number.MAX_VALUE; + $scope.model.config.maxNumber = isNumeric($scope.model.config.maxNumber) && $scope.model.config.maxNumber !== 0 ? $scope.model.config.maxNumber : Number.MAX_VALUE; $scope.newCaption = ''; $scope.newLink = 'http://'; @@ -160,7 +160,7 @@ cancel: '.no-drag', containment: 'parent', helper: function (e, ui) { - // When sorting , the cells collapse. This helper fixes that: http://www.foliotek.com/devblog/make-table-rows-sortable-using-jquery-ui-sortable/ + // When sorting table rows, the cells collapse. This helper fixes that: http://www.foliotek.com/devblog/make-table-rows-sortable-using-jquery-ui-sortable/ ui.children().each(function () { $(this).width($(this).width()); }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index 126982267f..f5f49881d0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -13,11 +13,11 @@ - + {{link.caption}} - +
{{link.link}} @@ -49,10 +49,10 @@ - + - +
@@ -68,7 +68,7 @@
- +
diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs index 6001d9c54e..751774eeba 100644 --- a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs @@ -11,15 +11,15 @@ namespace Umbraco.Web.PropertyEditors [PropertyEditor(Constants.PropertyEditors.RelatedLinksAlias, "Related links", "relatedlinks", ValueType ="JSON", Icon="icon-thumbnail-list", Group="pickers")] public class RelatedLinksPropertyEditor : PropertyEditor { - //protected override PreValueEditor CreatePreValueEditor() - //{ - // return new RelatedLinksPreValueEditor(); - //} + protected override PreValueEditor CreatePreValueEditor() + { + return new RelatedLinksPreValueEditor(); + } - //internal class RelatedLinksPreValueEditor : PreValueEditor - //{ - // [PreValueField("maxNumber", "Maximum number of items", "number")] - // public int MaxNumber { get; set; } - //} + internal class RelatedLinksPreValueEditor : PreValueEditor + { + [PreValueField("maxNumber", "Maximum number of items", "number")] + public int MaxNumber { get; set; } + } } } From 6f078989797516f59b25b08a014ddf2c69f5d221 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Mon, 1 Feb 2016 02:13:05 +0100 Subject: [PATCH 3/9] Max config adjustments --- .../propertyeditors/relatedlinks/relatedlinks.controller.js | 4 ++-- src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index af7ea0cb24..463c635570 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -6,7 +6,7 @@ $scope.model.value = []; } - $scope.model.config.maxNumber = isNumeric($scope.model.config.maxNumber) && $scope.model.config.maxNumber !== 0 ? $scope.model.config.maxNumber : Number.MAX_VALUE; + $scope.model.config.max = isNumeric($scope.model.config.max) && $scope.model.config.max !== 0 ? $scope.model.config.max : Number.MAX_VALUE; $scope.newCaption = ''; $scope.newLink = 'http://'; @@ -145,7 +145,7 @@ //helper for determining if a user can add items $scope.canAdd = function () { - return $scope.model.config.maxNumber > countVisible(); + return $scope.model.config.max <= 0 || $scope.model.config.max > countVisible(); } //helper that returns if an item can be sorted diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs index 751774eeba..732f478a80 100644 --- a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs @@ -18,7 +18,7 @@ namespace Umbraco.Web.PropertyEditors internal class RelatedLinksPreValueEditor : PreValueEditor { - [PreValueField("maxNumber", "Maximum number of items", "number")] + [PreValueField("max", "Maximum number of links", "number", Description = "Enter the maximum amount of links to be added, enter 0 for unlimited")] public int MaxNumber { get; set; } } } From 6d4364a8b9b7fe38f5c349b7fc9226dfa46f0ca6 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Tue, 2 Feb 2016 03:47:10 +0100 Subject: [PATCH 4/9] Modify sortable table row --- .../src/less/property-editors.less | 12 ++++++++-- .../relatedlinks/relatedlinks.controller.js | 23 +++++++++++++++++++ .../relatedlinks/relatedlinks.html | 1 + 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index 5033dacb2d..f67b1d804c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -628,8 +628,16 @@ ul.color-picker li a { /* sortable placeholder */ .umb-relatedlinks .sortable-placeholder { - //background-color: #fff; - margin-bottom: 47px; + background-color: #efefef; + display: table-row; +} +.umb-relatedlinks .sortable-placeholder > td { + display: table-cell; + padding: 8px; +} +.umb-relatedlinks .ui-sortable-helper { + background-color: #fff; + opacity: 0.5; } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index 463c635570..cc13dd33c9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -75,6 +75,9 @@ $scope.model.value[idx].edit = true; }; + $scope.cancelEdit = function (idx) { + $scope.model.value[idx].edit = false; + }; $scope.saveEdit = function (idx) { $scope.model.value[idx].title = $scope.model.value[idx].caption; @@ -159,6 +162,8 @@ cursor: 'move', cancel: '.no-drag', containment: 'parent', + placeholder: 'sortable-placeholder', + forcePlaceholderSize: true, helper: function (e, ui) { // When sorting table rows, the cells collapse. This helper fixes that: http://www.foliotek.com/devblog/make-table-rows-sortable-using-jquery-ui-sortable/ ui.children().each(function () { @@ -178,6 +183,24 @@ var movedElement = $scope.model.value[originalIndex]; $scope.model.value.splice(originalIndex, 1); $scope.model.value.splice(newIndex, 0, movedElement); + }, + start: function (e, ui) { + //ui.placeholder.html(""); + + // Build a placeholder cell that spans all the cells in the row: http://stackoverflow.com/questions/25845310/jquery-ui-sortable-and-table-cell-size + var cellCount = 0; + $('td, th', ui.helper).each(function () { + // For each td or th try and get it's colspan attribute, and add that or 1 to the total + var colspan = 1; + var colspanAttr = $(this).attr('colspan'); + if (colspanAttr > 1) { + colspan = colspanAttr; + } + cellCount += colspan; + }); + + // Add the placeholder UI - note that this is the item's content, so td rather than tr + ui.placeholder.html(' '); } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index f5f49881d0..578d6a576a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -45,6 +45,7 @@
+
From b8c7b09d25222b5746e5f6e293c5d1ecee8b33c0 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Wed, 3 Feb 2016 02:29:21 +0100 Subject: [PATCH 5/9] Update styles + adjust sort of table row --- .../src/less/property-editors.less | 24 +++++++++-- .../relatedlinks/relatedlinks.controller.js | 8 +--- .../relatedlinks/relatedlinks.html | 43 +++++++++++-------- 3 files changed, 48 insertions(+), 27 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index f67b1d804c..d99c35f485 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -622,13 +622,24 @@ ul.color-picker li a { // // Related links // -------------------------------------------------- -.umb-relatedlinks table > tr > td { word-wrap:break-word; word-break: break-all; } +.umb-relatedlinks table > tr > td { word-wrap:break-word; word-break: break-all; border-bottom: 1px solid transparent; } .umb-relatedlinks .handle { cursor:move; } .umb-relatedlinks table > tbody > tr.unsortable .handle { cursor:default; } +.umb-relatedlinks table td.col-sort { width: 20px; } +.umb-relatedlinks table td.col-caption { min-width: 200px; } +.umb-relatedlinks table td.col-link { min-width: 200px; } +.umb-relatedlinks table td.col-actions { min-width: 120px; } + +.umb-relatedlinks table td.col-caption .control-wrapper, +.umb-relatedlinks table td.col-link .control-wrapper { display: flex; } + +.umb-relatedlinks table td.col-caption .control-wrapper input[type="text"], +.umb-relatedlinks table td.col-link .control-wrapper input[type="text"] { width: auto; flex: 1; } + /* sortable placeholder */ .umb-relatedlinks .sortable-placeholder { - background-color: #efefef; + background-color: @tableBackgroundAccent; display: table-row; } .umb-relatedlinks .sortable-placeholder > td { @@ -636,8 +647,13 @@ ul.color-picker li a { padding: 8px; } .umb-relatedlinks .ui-sortable-helper { - background-color: #fff; - opacity: 0.5; + display: table-row; + background-color: @white; + opacity: 0.7; +} +.umb-relatedlinks .ui-sortable-helper > td { + display: table-cell; + border-bottom: 1px solid @tableBorder; } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index cc13dd33c9..01b465daba 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -74,10 +74,6 @@ } $scope.model.value[idx].edit = true; }; - - $scope.cancelEdit = function (idx) { - $scope.model.value[idx].edit = false; - }; $scope.saveEdit = function (idx) { $scope.model.value[idx].title = $scope.model.value[idx].caption; @@ -199,8 +195,8 @@ cellCount += colspan; }); - // Add the placeholder UI - note that this is the item's content, so td rather than tr - ui.placeholder.html(' '); + // Add the placeholder UI - note that this is the item's content, so td rather than tr - and set height of tr + ui.placeholder.html('').height(ui.item.height()); } }; diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index 578d6a576a..17358e0628 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -12,21 +12,25 @@ - - + + {{link.caption}} - +
+ +
- +
Choose
@@ -34,30 +38,35 @@
- + {{link.newWindow}} - +
-
- - - + + +
+ +
+ +
- -
or +
+ +
+ or choose internal page
@@ -66,8 +75,8 @@ or enter external link
- - + +
From 4bcee1df711bad2208d9840cd17f0ffa691c8c35 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Wed, 3 Feb 2016 02:42:47 +0100 Subject: [PATCH 6/9] Change property to maximum --- src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs index 732f478a80..1fc4d7f471 100644 --- a/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/RelatedLinksPropertyEditor.cs @@ -19,7 +19,7 @@ namespace Umbraco.Web.PropertyEditors internal class RelatedLinksPreValueEditor : PreValueEditor { [PreValueField("max", "Maximum number of links", "number", Description = "Enter the maximum amount of links to be added, enter 0 for unlimited")] - public int MaxNumber { get; set; } + public int Maximum { get; set; } } } } From 2d6b8712d5c220b3bdeb71e1cd52871ca9095df8 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Wed, 6 Apr 2016 19:44:09 +0200 Subject: [PATCH 7/9] Limit this to listview, so it doesn't affect other property editors. --- src/Umbraco.Web.UI.Client/src/less/listview.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/listview.less b/src/Umbraco.Web.UI.Client/src/less/listview.less index 87d5f9a5e2..88762edf0c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/listview.less +++ b/src/Umbraco.Web.UI.Client/src/less/listview.less @@ -244,7 +244,7 @@ } /* don't hide all icons, e.g. for a sortable handle */ -.table-striped tbody i:not(.handle):hover { +.umb-listview .table-striped tbody i:not(.handle):hover { display: none !important } From 2c29e422bc17d284022061533177221fa049db2d Mon Sep 17 00:00:00 2001 From: bjarnef Date: Wed, 6 Apr 2016 19:47:05 +0200 Subject: [PATCH 8/9] Add icons for internal links. --- .../relatedlinks/relatedlinks.controller.js | 8 ++++++-- .../views/propertyeditors/relatedlinks/relatedlinks.html | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js index 01b465daba..cb6c8e595a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.controller.js @@ -1,6 +1,6 @@ angular.module("umbraco") .controller("Umbraco.PropertyEditors.RelatedLinksController", - function ($rootScope, $scope, dialogService) { + function ($rootScope, $scope, dialogService, iconHelper) { if (!$scope.model.value) { $scope.model.value = []; @@ -13,6 +13,7 @@ $scope.newNewWindow = false; $scope.newInternal = null; $scope.newInternalName = ''; + $scope.newInternalIcon = null; $scope.addExternal = true; $scope.currentEditLink = null; $scope.hasError = false; @@ -108,6 +109,7 @@ this.edit = false; this.isInternal = true; this.internalName = $scope.newInternalName; + this.internalIcon = $scope.newInternalIcon; this.type = "internal"; this.title = $scope.newCaption; }; @@ -118,7 +120,7 @@ $scope.newNewWindow = false; $scope.newInternal = null; $scope.newInternalName = ''; - + $scope.newInternalIcon = null; } $event.preventDefault(); }; @@ -223,10 +225,12 @@ if ($scope.currentEditLink != null) { $scope.currentEditLink.internal = data.id; $scope.currentEditLink.internalName = data.name; + $scope.currentEditLink.internalIcon = iconHelper.convertFromLegacyIcon(data.icon); $scope.currentEditLink.link = data.id; } else { $scope.newInternal = data.id; $scope.newInternalName = data.name; + $scope.newInternalIcon = iconHelper.convertFromLegacyIcon(data.icon); } } }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index 17358e0628..e3f74c6e21 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -21,6 +21,7 @@ @@ -33,6 +34,7 @@ @@ -71,6 +73,7 @@ From ae154885e4ee7206f9232acf5f7e74d118e17e79 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Wed, 6 Apr 2016 19:52:21 +0200 Subject: [PATCH 9/9] Ensure icon has a value. --- .../views/propertyeditors/relatedlinks/relatedlinks.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html index e3f74c6e21..e7d3b67de3 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/relatedlinks/relatedlinks.html @@ -21,7 +21,7 @@ @@ -34,7 +34,7 @@ @@ -73,7 +73,7 @@