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

Commit

Permalink
Ellipsis is handled by CSS, it degraded performances for Details view.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 11, 2013
1 parent c6c0292 commit 2039669
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
14 changes: 12 additions & 2 deletions core/src/plugins/gui.ajax/res/js/ajaxplorer/class.FilesList.js
Expand Up @@ -690,7 +690,13 @@ Class.create("FilesList", SelectableElements, {
}.bind(this);
if(this.paginationData && this.paginationData.get('remote_order') && parseInt(this.paginationData.get('total')) > 1){
this._sortableTable.setPaginationBehaviour(function(params){
this.reload(params);
this.getCurrentContextNode().getMetadata().set("remote_order", params);
var oThis = this;
this.crtContext.observeOnce("loaded", function(){
oThis.crtContext = this ;
oThis.fill(oThis.crtContext);
});
this.getCurrentContextNode().reload();
}.bind(this), this.columnsDef, this.paginationData.get('currentOrderCol')||-1, this.paginationData.get('currentOrderDir') );
}
this.disableTextSelection(this.htmlElement.down('div.sort-table'), true);
Expand Down Expand Up @@ -1970,6 +1976,7 @@ Class.create("FilesList", SelectableElements, {
var elList;
if(one_element) elList = [one_element];
else elList = this._htmlElement.select('div.thumbnail_selectable_cell');
var ellipsisDetected;
elList.each(function(element){
if(element.up('div.thumbnail_selectable_cell.detailed')) return;
var node = element.ajxpNode;
Expand All @@ -1986,7 +1993,10 @@ Class.create("FilesList", SelectableElements, {
if(image_element){
this._previewFactory.resizeThumbnail(image_element);
}
if(label_element){
if(ellipsisDetected == undefined){
ellipsisDetected = label_element.getStyle('textOverflow') == "ellipsis";
}
if(label_element && !ellipsisDetected){
// RESIZE LABEL
var el_width = (!elementsAreSiblings ? (element.getWidth() - tSize - 10) : (tSize + 25) ) ;
var charRatio = 6;
Expand Down
Expand Up @@ -481,7 +481,9 @@ Class.create("FormManager", {
}else{
fElements = $A([fElement]);
}
fElements.invoke((state?"disable":"enable"));
fElements.each(function(el){
if(el && el[(state?"disable":"enable")]) el[(state?"disable":"enable")]();
});
if(state) cbox.previous("div.SF_label").addClassName("SF_disabled");
else cbox.previous("div.SF_label").removeClassName("SF_disabled");
});
Expand Down
Expand Up @@ -221,6 +221,9 @@ div.thumbnail_cell_metadata span.metadata_chunk{
.thumbLabel
{
/*overflow: hidden;*/
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

.img_cont
Expand Down

0 comments on commit 2039669

Please sign in to comment.