Some fixes for tile view after Typescript conversion

This commit is contained in:
nathangray 2020-03-23 10:05:46 -06:00
parent 7e1da8d909
commit 3350f3a024
4 changed files with 147 additions and 147 deletions

View File

@ -740,6 +740,17 @@ var et2_nextmatch = /** @class */ (function (_super) {
else {
colName = this._getColumnName(_row[i].widget);
}
_colData[i].visible = negated;
var stop_1 = false;
for (var j = 0; j < columnDisplay.length && !stop_1; j++) {
if (columnDisplay[j] == colName) {
_colData[i].visible = !negated;
stop_1 = true;
}
}
if (!negated) {
_colData[i].order = typeof order[colName] === 'undefined' ? i : order[colName];
}
if (!colName)
continue;
if (size[colName]) {
@ -751,16 +762,6 @@ var et2_nextmatch = /** @class */ (function (_super) {
_colData[i].width = parseInt(size[colName]) + 'px';
}
}
if (!negated) {
_colData[i].order = typeof order[colName] === 'undefined' ? i : order[colName];
}
for (var j = 0; j < columnDisplay.length; j++) {
if (columnDisplay[j] == colName) {
_colData[i].visible = !negated;
continue RowLoop;
}
}
_colData[i].visible = negated;
}
}
_colData.sort(function (a, b) {
@ -968,7 +969,8 @@ var et2_nextmatch = /** @class */ (function (_super) {
columnWidgets[x] = _row[x].widget;
// Append the widget to this container
this.addChild(_row[x].widget);
} else {
}
else {
columnWidgets[x] = _row[x].widget;
}
// Pass along column alignment
@ -1421,7 +1423,7 @@ var et2_nextmatch = /** @class */ (function (_super) {
// We don't use iterateOver because it checks sub-children
for (var i = this._children.length - 1; i >= 0; i--) {
var _node = this._children[i];
if (_node != this.header) {
if (_node != this.header && _node !== template) {
this.removeChild(_node);
_node.destroy();
}
@ -1433,9 +1435,6 @@ var et2_nextmatch = /** @class */ (function (_super) {
}
this.dataview = new et2_dataview_1.et2_dataview(this.innerDiv, this.egw());
}
// Create the template
if (template_name) {
}
if (!template) {
this.egw().debug("error", "Error while loading definition template for " +
"nextmatch widget.", template_name);

View File

@ -1054,6 +1054,20 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
{
colName = this._getColumnName(_row[i].widget);
}
_colData[i].visible = negated;
let stop = false;
for(var j = 0; j < columnDisplay.length && !stop; j++)
{
if(columnDisplay[j] == colName)
{
_colData[i].visible = !negated;
stop = true;
}
}
if(!negated)
{
_colData[i].order = typeof order[colName] === 'undefined' ? i : order[colName];
}
if(!colName) continue;
if(size[colName])
@ -1068,20 +1082,6 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
_colData[i].width = parseInt(size[colName])+'px';
}
}
if(!negated)
{
_colData[i].order = typeof order[colName] === 'undefined' ? i : order[colName];
}
for(var j = 0; j < columnDisplay.length; j++)
{
if(columnDisplay[j] == colName)
{
_colData[i].visible = !negated;
continue RowLoop;
}
}
_colData[i].visible = negated;
}
}
@ -1941,7 +1941,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
// We don't use iterateOver because it checks sub-children
for (let i = this._children.length - 1; i >= 0; i--) {
const _node = this._children[i];
if (_node != this.header) {
if (_node != this.header && _node !== template) {
this.removeChild(_node);
_node.destroy();
}
@ -1955,11 +1955,6 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
this.dataview = new et2_dataview(this.innerDiv, this.egw());
}
// Create the template
if (template_name)
{
}
if (!template)
{
this.egw().debug("error", "Error while loading definition template for " +

View File

@ -307,7 +307,13 @@ var filemanagerAPP = /** @class */ (function (_super) {
for (var file in _data.uploaded) {
if (_data.uploaded[file].confirm && !_data.uploaded[file].confirmed) {
var buttons = [
{ text: this.egw.lang("Yes"), id: "overwrite", class: "ui-priority-primary", "default": true, image: 'check' },
{
text: this.egw.lang("Yes"),
id: "overwrite",
class: "ui-priority-primary",
"default": true,
image: 'check'
},
{ text: this.egw.lang("Rename"), id: "rename", image: 'edit' },
{ text: this.egw.lang("Cancel"), id: "cancel" }
];
@ -612,14 +618,14 @@ var filemanagerAPP = /** @class */ (function (_super) {
}
// Toggle button icon to the other view
//todo: nm.controller needs to be changed to nm.getController after merging typescript branch into master
button_widget.set_image("list_" + (view == nm.getController().VIEW_ROW ? nm.getController().VIEW_TILE : nm.getController().VIEW_ROW));
button_widget.set_statustext(view == nm.getController().VIEW_ROW ? this.egw.lang("Tile view") : this.egw.lang('List view'));
button_widget.set_image("list_" + (view == et2_nextmatch_controller.VIEW_ROW ? et2_nextmatch_controller.VIEW_TILE : et2_nextmatch_controller.VIEW_ROW));
button_widget.set_statustext(view == et2_nextmatch_controller.VIEW_ROW ? this.egw.lang("Tile view") : this.egw.lang('List view'));
}
nm.set_view(view);
// Put it into active filters (but don't refresh)
nm.activeFilters["view"] = view;
// Change template to match
var template = view == nm.getController().VIEW_ROW ? 'filemanager.index.rows' : 'filemanager.tile';
var template = view == et2_nextmatch_controller.VIEW_ROW ? 'filemanager.index.rows' : 'filemanager.tile';
nm.set_template(template);
// Wait for template to load, then refresh
template = nm.getWidgetById(template);

View File

@ -744,9 +744,9 @@ export class filemanagerAPP extends EgwApp
// Toggle button icon to the other view
//todo: nm.controller needs to be changed to nm.getController after merging typescript branch into master
button_widget.set_image("list_"+(view == nm.getController().VIEW_ROW ? nm.getController().VIEW_TILE : nm.getController().VIEW_ROW));
button_widget.set_image("list_"+(view == et2_nextmatch_controller.VIEW_ROW ? et2_nextmatch_controller.VIEW_TILE : et2_nextmatch_controller.VIEW_ROW));
button_widget.set_statustext(view == nm.getController().VIEW_ROW ? this.egw.lang("Tile view") : this.egw.lang('List view'));
button_widget.set_statustext(view == et2_nextmatch_controller.VIEW_ROW ? this.egw.lang("Tile view") : this.egw.lang('List view'));
}
nm.set_view(view);
@ -754,7 +754,7 @@ export class filemanagerAPP extends EgwApp
nm.activeFilters["view"]= view;
// Change template to match
let template : any = view == nm.getController().VIEW_ROW ? 'filemanager.index.rows' : 'filemanager.tile';
let template : any = view == et2_nextmatch_controller.VIEW_ROW ? 'filemanager.index.rows' : 'filemanager.tile';
nm.set_template(template);
// Wait for template to load, then refresh