Fixes: U4-7837 Changing document type should refresh the current node
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
@@ -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>");
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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}');"; } }
|
||||
|
||||
Reference in New Issue
Block a user