ignores some properties from being updated after saving otherwise we get duplicate tabs, etc...

This commit is contained in:
Shannon
2013-10-15 15:12:44 +11:00
parent dfec3965ab
commit e7162d46ce
2 changed files with 12 additions and 3 deletions

View File

@@ -52,8 +52,20 @@ function contentEditingHelper($location, $routeParams, notificationsService, ser
});
}
//a method to ignore built-in prop changes
var shouldIgnore = function(propName) {
return _.some(["tabs", "notifications", "ModelState", "tabs", "properties"], function(i) {
return i === propName;
});
};
//check for changed built-in properties of the content
for (var o in origContent) {
//ignore the ones listed in the array
if (shouldIgnore(o)) {
continue;
}
if (!_.isEqual(origContent[o], newContent[o])) {
origContent[o] = newContent[o];
}

View File

@@ -14,9 +14,6 @@ namespace Umbraco.Web.Models.ContentEditing
[DataContract(Name = "content", Namespace = "")]
public class ContentItemDisplay : ContentItemDisplayBase<ContentPropertyDisplay, IContent>
{
[DataMember(Name = "path")]
public string Path { get; set; }
[DataMember(Name = "publishDate")]
public DateTime? PublishDate { get; set; }