From 29d849754ce90698e1e01d9d34ba7fbe09ebcd5e Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 26 Sep 2013 12:53:33 +1000 Subject: [PATCH] Fixes: U4-2703 Content editor save/publish should update modified attributes --- .../services/contenteditinghelper.service.js | 5 +---- .../urllist/urllist.controller.js | 22 ++++++++++++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js index 60fbbefcf2..a85cc8024c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js @@ -46,10 +46,7 @@ function contentEditingHelper($location, $routeParams, notificationsService, ser var allOrigProps = this.getAllProps(origContent); var allNewProps = this.getAllProps(newContent); - function getNewProp(alias) { - if (alias.startsWith("_umb_")) { - return null; - } + function getNewProp(alias) { return _.find(allNewProps, function (item) { return item.alias === alias; }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.controller.js index cc0053dc62..6dcd33847a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/urllist/urllist.controller.js @@ -1,11 +1,23 @@ angular.module('umbraco').controller("Umbraco.Editors.UrlListController", function($rootScope, $scope, $filter) { - $scope.renderModel = _.map($scope.model.value.split(","), function(item) { - return { - url: item, - urlTarget : ($scope.config && $scope.config.target) ? $scope.config.target : "_blank" - }; + function formatDisplayValue() { + $scope.renderModel = _.map($scope.model.value.split(","), function (item) { + return { + url: item, + urlTarget: ($scope.config && $scope.config.target) ? $scope.config.target : "_blank" + }; + }); + } + + formatDisplayValue(); + + //we need to put a watch on the real model because when it changes we have to update our renderModel + $scope.$watch("model.value", function (newVal, oldVal) { + if (newVal !== null && newVal !== undefined && newVal !== oldVal) { + //update the display val again + formatDisplayValue(); + } }); }); \ No newline at end of file