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

Commit

Permalink
GUI :
Browse files Browse the repository at this point in the history
AjxpTabulator: new option uniqueTab will always replace existing editor in tab.
FilesList: call fit:content inside resizeThumbnails() function
Last compile
  • Loading branch information
cdujeu committed Apr 19, 2014
1 parent f6c0a6f commit f741fd3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/gui.ajax/res/js/ajaxplorer.js

Large diffs are not rendered by default.

Expand Up @@ -144,6 +144,25 @@ Class.create("AjxpTabulator", AjxpPane, {
},

openEditorForNode:function(ajxpNode, editorData){
if(this.options.uniqueTab){
// Unique Tab: close anyway
var editorId = 'unique-editor';
var existing = this.tabulatorData.detect(function(internalInfo){return internalInfo.id == editorId;});
if(existing && existing.ajxpObject) {
this.closeTab(editorId, true);
}
this.addTab({
id:editorId,
label:editorData.text,
iconClass:editorData.icon_class,
closeable:true
}, {
type:"editor",
editorData:editorData,
node:ajxpNode
});
return;
}
this.addTab({
id:editorData.id + ":/" + ajxpNode.getPath(),
label:editorData.text,
Expand Down Expand Up @@ -339,7 +358,7 @@ Class.create("AjxpTabulator", AjxpPane, {
* @param tabId String The id of the target tab
*/
switchTabulator:function(tabId){
if(this.crtTabId && this.crtTabId == tabId) return;
if(this.crtTabId && this.crtTabId == tabId && !this.options.uniqueTab) return;
var toShow ;
var toShowElement;
this.tabulatorData.each(function(tabInfo){
Expand Down
Expand Up @@ -841,9 +841,6 @@ Class.create("FilesList", SelectableElements, {
{
this._thumbSize = value;
this.resizeThumbnails();
if(this.options.fit && this.options.fit == 'content'){
this.resize();
}
}.bind(this),
onChange : function(value){
if(this.options.replaceScroller){
Expand Down Expand Up @@ -2131,6 +2128,9 @@ Class.create("FilesList", SelectableElements, {
var scrollElement = this.htmlElement.down(".selectable_div");
scrollElement.setStyle({width:(elList.length * (this._thumbSize + 46)) + 'px'});
}
if(this.options.fit && this.options.fit == 'content'){
this.resize();
}

},
/**
Expand Down

0 comments on commit f741fd3

Please sign in to comment.