mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Import/export: Fix3032 - importing document botches pad options (#3769)
Fixes #3032
This commit is contained in:
parent
e859edd8ab
commit
13bd859f31
1 changed files with 16 additions and 5 deletions
|
@ -437,16 +437,27 @@ var pad = {
|
||||||
},
|
},
|
||||||
switchToPad: function(padId)
|
switchToPad: function(padId)
|
||||||
{
|
{
|
||||||
|
var newHref = new RegExp(/.*\/p\/[^\/]+/).exec(document.location.pathname) || clientVars.padId;
|
||||||
|
newHref = newHref[0];
|
||||||
|
|
||||||
|
var options = clientVars.padOptions;
|
||||||
|
if (typeof options != "undefined" && options != null)
|
||||||
|
{
|
||||||
|
var option_str = [];
|
||||||
|
$.each(options, function(k,v) {
|
||||||
|
var str = k + "=" + v;
|
||||||
|
option_str.push(str);
|
||||||
|
});
|
||||||
|
var option_str = option_str.join("&");
|
||||||
|
|
||||||
|
newHref = newHref + '?' + option_str;
|
||||||
|
}
|
||||||
|
|
||||||
// destroy old pad from DOM
|
// destroy old pad from DOM
|
||||||
// See https://github.com/ether/etherpad-lite/pull/3915
|
// See https://github.com/ether/etherpad-lite/pull/3915
|
||||||
// TODO: Check if Destroying is enough and doesn't leave negative stuff
|
// TODO: Check if Destroying is enough and doesn't leave negative stuff
|
||||||
// See ace.js "editor.destroy" for a reference of how it was done before
|
// See ace.js "editor.destroy" for a reference of how it was done before
|
||||||
$('#editorcontainer').find("iframe")[0].remove();
|
$('#editorcontainer').find("iframe")[0].remove();
|
||||||
var options = document.location.href.split('?')[1];
|
|
||||||
var newHref = padId;
|
|
||||||
if (typeof options != "undefined" && options != null){
|
|
||||||
newHref = newHref + '?' + options;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(window.history && window.history.pushState)
|
if(window.history && window.history.pushState)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue