Fixes: U4-7837 Changing document type should refresh the current node

This commit is contained in:
Claus
2016-02-05 14:37:01 +01:00
parent 4d74ec7785
commit 44f2a9e96f
5 changed files with 26 additions and 4 deletions

View File

@@ -361,6 +361,12 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
rootScope : function(){
return getRootScope();
},
reloadLocation: function() {
var injector = getRootInjector();
var $route = injector.get("$route");
$route.reload();
},
closeModalWindow: function(rVal) {

View File

@@ -263,7 +263,7 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs
ClientTools.SyncTree(_content.Path, true);
// Reload the page if the content was already being viewed
ClientTools.ReloadContentFrameUrlIfPathLoaded("/editContent.aspx?id=" + _content.Id);
ClientTools.ReloadLocation();
// Display success message
SuccessMessage.Text = global::umbraco.ui.Text("changeDocType", "successMessage").Replace("[new type]", "<strong>" + newContentType.Name + "</strong>");

View File

@@ -151,7 +151,6 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
/** This is used to launch an angular based modal window instead of the legacy window */
openAngularModalWindow: function (options) {
if (!this.mainWindow().UmbClientMgr) {
throw "An angular modal window can only be launched when the modal is running within the main Umbraco application";
}
@@ -173,6 +172,12 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
},
reloadLocation: function () {
if (this.mainWindow().UmbClientMgr) {
this.mainWindow().UmbClientMgr.reloadLocation();
}
},
openModalWindow: function(url, name, showHeader, width, height, top, leftOffset, closeTriggers, onCloseCallback) {
//need to create the modal on the top window if the top window has a client manager, if not, create it on the current window

View File

@@ -52,6 +52,7 @@ namespace Umbraco.Web.UI.Pages
{
return string.Format(ClientMgrScript + ".reloadContentFrameUrlIfPathLoaded('{0}');", url);
}
public static string ReloadLocation { get { return string.Format(ClientMgrScript + ".reloadLocation();"); } }
public static string ChildNodeCreated = GetMainTree + ".childNodeCreated();";
public static string SyncTree { get { return GetMainTree + ".syncTree('{0}', {1});"; } }
public static string ClearTreeCache { get { return GetMainTree + ".clearTreeCache();"; } }
@@ -173,6 +174,16 @@ namespace Umbraco.Web.UI.Pages
return this;
}
/// <summary>
/// Reloads location, refreshing what is in the content frame
/// </summary>
public ClientTools ReloadLocation()
{
RegisterClientScript(Scripts.ReloadLocation);
return this;
}
private string EnsureUmbracoUrl(string url)
{
if (url.StartsWith("/") && url.StartsWith(IOHelper.ResolveUrl(SystemDirectories.Umbraco)) == false)

View File

@@ -52,8 +52,8 @@ 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 ReloadLocation { get { return string.Format(ClientMgrScript + ".reloadLocation();"); } }
public static string ChildNodeCreated = GetMainTree + ".childNodeCreated();";
public static string SyncTree { get { return GetMainTree + ".syncTree('{0}', {1});"; } }
public static string ClearTreeCache { get { return GetMainTree + ".clearTreeCache();"; } }
public static string CopyNode { get { return GetMainTree + ".copyNode('{0}', '{1}');"; } }