tree syncing
This commit is contained in:
@@ -123,8 +123,7 @@ angular.module("umbraco.directives")
|
||||
|
||||
//watch for section changes
|
||||
scope.$watch("section", function (newVal, oldVal) {
|
||||
|
||||
if(!scope.tree){
|
||||
if(!scope.tree){
|
||||
loadTree();
|
||||
}
|
||||
|
||||
@@ -141,6 +140,18 @@ angular.module("umbraco.directives")
|
||||
}
|
||||
});
|
||||
|
||||
//watch for path changes
|
||||
scope.$watch("path", function (newVal, oldVal) {
|
||||
|
||||
if(!scope.tree){
|
||||
loadTree();
|
||||
}
|
||||
if (newVal && newVal !== oldVal) {
|
||||
//only reload the tree data and Dom if the newval is different from the old one
|
||||
loadTree();
|
||||
}
|
||||
});
|
||||
|
||||
//watch for active tree changes
|
||||
scope.$watch("activetree", function (newVal, oldVal) {
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @description
|
||||
* The controller for the content editor
|
||||
*/
|
||||
function ContentEditController($scope, $routeParams, $q, $timeout, $window, contentResource, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, editorContextService) {
|
||||
function ContentEditController($scope, $routeParams, $q, $timeout, $window, contentResource, navigationService, notificationsService, angularHelper, serverValidationManager, contentEditingHelper, fileManager, editorContextService) {
|
||||
|
||||
//initialize the file manager
|
||||
fileManager.clearFiles();
|
||||
@@ -49,6 +49,8 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, cont
|
||||
newContent: data,
|
||||
rebindCallback: contentEditingHelper.reBindChangedProperties($scope.content, data)
|
||||
});
|
||||
|
||||
navigationService.syncPath(data.path.split(","));
|
||||
});
|
||||
};
|
||||
|
||||
@@ -73,6 +75,8 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, cont
|
||||
rebindCallback: contentEditingHelper.reBindChangedProperties($scope.content, data)
|
||||
});
|
||||
|
||||
navigationService.syncPath(data.path.split(","));
|
||||
|
||||
}, function (err) {
|
||||
|
||||
contentEditingHelper.handleSaveError({
|
||||
@@ -124,8 +128,9 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, cont
|
||||
rebindCallback: contentEditingHelper.reBindChangedProperties($scope.content, data)
|
||||
});
|
||||
|
||||
deferred.resolve(data);
|
||||
navigationService.syncPath(data.path.split(","));
|
||||
|
||||
deferred.resolve(data);
|
||||
}, function (err) {
|
||||
contentEditingHelper.handleSaveError({
|
||||
err: err,
|
||||
|
||||
@@ -339,11 +339,9 @@ namespace Umbraco.Web.Editors
|
||||
/// attributed with EnsureUserPermissionForContent to verify the user has access to the recycle bin
|
||||
/// </remarks>
|
||||
[HttpDelete]
|
||||
[EnsureUserPermissionForContent(Constants.System.RecycleBinContent)]
|
||||
/* [EnsureUserPermissionForContent(Constants.System.RecycleBinContent)]*/
|
||||
public HttpResponseMessage EmptyRecycleBin()
|
||||
{
|
||||
//TODO: We need to check if the user is allowed access to the recycle bin!
|
||||
|
||||
Services.ContentService.EmptyRecycleBin();
|
||||
return Request.CreateResponse(HttpStatusCode.OK);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,9 @@ 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; }
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace umbraco.BasePages
|
||||
public static string ReloadContentFrameUrlIfPathLoaded(string url) {
|
||||
return string.Format(ClientMgrScript + ".reloadContentFrameUrlIfPathLoaded('{0}');", url);
|
||||
}
|
||||
|
||||
public static string ChildNodeCreated = GetMainTree + ".childNodeCreated();";
|
||||
public static string SyncTree { get { return GetMainTree + ".syncTree('{0}', {1});"; } }
|
||||
public static string ClearTreeCache { get { return GetMainTree + ".clearTreeCache();"; } }
|
||||
@@ -240,7 +241,7 @@ namespace umbraco.BasePages
|
||||
/// </example>
|
||||
public ClientTools SyncTree(string path, bool forceReload)
|
||||
{
|
||||
//RegisterClientScript(string.Format(Scripts.SyncTree, path, forceReload.ToString().ToLower()));
|
||||
RegisterClientScript(string.Format(Scripts.SyncTree, path, forceReload.ToString().ToLower()));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user