Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix tabs re-opening / Fix 'circular JSON structure' error by filterin…
Browse files Browse the repository at this point in the history
…g data before saving.

(cherry picked from commit 96dff53)
  • Loading branch information
cdujeu committed Mar 17, 2014
1 parent e211a37 commit 1876892
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.AjxpTabulator.js
Expand Up @@ -366,8 +366,9 @@ Class.create("AjxpTabulator", AjxpPane, {
}
}.bind(this));
if(toShow){
if($(toShowElement) && !$(toShowElement).visible()){
if($(toShowElement) && (!$(toShowElement).visible() || parseInt($(toShowElement).getStyle("height")) == 0)){
if($(toShowElement)) $(toShowElement).show();
fitHeightToBottom($(toShowElement), null, this.options.fitMarginBottom);
toShow.showElement(true);
}
var reFold = false;
Expand All @@ -377,7 +378,7 @@ Class.create("AjxpTabulator", AjxpPane, {
splitter.unfold();
}
}
toShow.resize();
toShow.resize();
}
if(this.options.headerToolbarOptions){
ajaxplorer.actionBar.fireSelectionChange();
Expand Down Expand Up @@ -538,6 +539,20 @@ Class.create("AjxpTabulator", AjxpPane, {
this.tabsConfigs.get(tabInfo.id)['DATA'] = object.getStateData();
}
}.bind(this));
// Clean tabsConfigs
this.tabsConfigs.each(function(pair){
var confPaneInfo = pair.value.PANE;
if(confPaneInfo){
if(confPaneInfo.editorData) {
confPaneInfo.editorID = confPaneInfo.editorData.id;
delete confPaneInfo['editorData'];
}
if(confPaneInfo.node){
confPaneInfo.nodePath = confPaneInfo.node.getPath();
delete confPaneInfo['node'];
}
}
});
this.setUserPreference("tabs_state", this.tabsConfigs);
},

Expand All @@ -546,10 +561,14 @@ Class.create("AjxpTabulator", AjxpPane, {
if(!ajaxplorer || !ajaxplorer.user) return;
var pref = this.getUserPreference("tabs_state");
if(pref){
var index = 1;
$H(pref).each(function(pair){
if(pair.value.TAB && pair.value.PANE){
pair.value.TAB.dontFocus = true;
this.addTab(pair.value.TAB, pair.value.PANE, true);
window.setTimeout(function(){
this.addTab(pair.value.TAB, pair.value.PANE, true);
}.bind(this), index * 2000);
index ++;
}
if(pair.value.DATA){
var object = this.getAjxpObjectByTabId(pair.key);
Expand Down

0 comments on commit 1876892

Please sign in to comment.