mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Don't update CMS preview on a CMS redirect
The CMS preview causes unnecessary browser processing by loading a URL which should be considered "in transit" when a CMS redirect is set through the X-ControllerURL HTTP header. The CMS history processing will load this new URL, and cause a new preview URL to be loaded. Fixes https://github.com/silverstripe/silverstripe-translatable/issues/158
This commit is contained in:
parent
88ac537e96
commit
d5bb290b8e
@ -326,7 +326,10 @@
|
||||
* Update preview whenever any panels are reloaded.
|
||||
*/
|
||||
'from .cms-container': {
|
||||
onafterstatechange: function(){
|
||||
onafterstatechange: function(e, data) {
|
||||
// Don't update preview if we're dealing with a custom redirect
|
||||
if(data.xhr.getResponseHeader('X-ControllerURL')) return;
|
||||
|
||||
this._initialiseFromContent();
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user