got et2 mostly working: timesheet.edit renders

This commit is contained in:
Ralf Becker
2021-06-07 17:33:53 +02:00
parent 592b7fb97d
commit f91bca83e1
183 changed files with 11759 additions and 12588 deletions

View File

@ -1,34 +1,19 @@
"use strict";
/**
* EGroupware eTemplate2 - dataview code
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate
* @subpackage dataview
* @link http://www.egroupware.org
* @link https://www.egroupware.org
* @author Nathan Gray
* @copyright Nathan Gray 2014
* @version $Id: et2_dataview_view_container_1.js 46338 2014-03-20 09:40:37Z ralfbecker $
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.et2_dataview_tile = void 0;
/*egw:uses
/vendor/bower-asset/jquery/dist/jquery.js;
et2_dataview_interfaces;
*/
import { et2_dataview_row } from "./et2_dataview_view_row";
/**
* Displays tiles or thumbnails (squares) instead of full rows.
*
@ -36,8 +21,7 @@ exports.et2_dataview_tile = void 0;
* so that the rows and columns work out properly.
*
*/
var et2_dataview_tile = /** @class */ (function (_super) {
__extends(et2_dataview_tile, _super);
export class et2_dataview_tile extends et2_dataview_row {
/**
* Creates the row container. Use the "setRow" function to load the actual
* row content.
@ -45,25 +29,23 @@ var et2_dataview_tile = /** @class */ (function (_super) {
* @param _parent is the row parent container.
* @memberOf et2_dataview_row
*/
function et2_dataview_tile(_parent) {
var _this =
constructor(_parent) {
// Call the inherited constructor
_super.call(this, _parent) || this;
_this.columns = 4;
super(_parent);
this.columns = 4;
// Make sure the needed class is there to get the CSS
_this.tr.addClass('tile');
return _this;
this.tr.addClass('tile');
}
et2_dataview_tile.prototype.makeExpandable = function (_expandable, _callback, _context) {
makeExpandable(_expandable, _callback, _context) {
// Nope. It mostly works, it's just weird.
};
et2_dataview_tile.prototype.getAvgHeightData = function () {
}
getAvgHeightData() {
var res = {
"avgHeight": this.getHeight() / this.columns,
"avgCount": this.columns
};
return res;
};
}
/**
* Returns the height for the tile.
*
@ -71,19 +53,19 @@ var et2_dataview_tile = /** @class */ (function (_super) {
* height. If this should be another tile in the same row, we say it has 0 height.
* @returns {Number}
*/
et2_dataview_tile.prototype.getHeight = function () {
getHeight() {
if (this._index % this.columns == 0) {
return _super.prototype.getHeight.call(this);
return super.getHeight();
}
else {
return 0;
}
};
}
/**
* Broadcasts an invalidation through the container tree. Marks the own
* height as invalid.
*/
et2_dataview_tile.prototype.invalidate = function () {
invalidate() {
if (this._inTree && this.tr) {
var template_width = jQuery('.innerContainer', this.tr).children().outerWidth(true);
if (template_width) {
@ -91,19 +73,17 @@ var et2_dataview_tile = /** @class */ (function (_super) {
}
}
this._recalculate_columns();
_super.prototype.invalidate.call(this);
};
super.invalidate();
}
/**
* Recalculate how many columns we can fit in a row.
* While browser takes care of the actual layout, we need this for proper
* pagination.
*/
et2_dataview_tile.prototype._recalculate_columns = function () {
_recalculate_columns() {
if (this._inTree && this.tr && this.tr.parent()) {
this.columns = Math.max(1, parseInt(this.tr.parent().innerWidth() / this.tr.outerWidth(true)));
}
};
return et2_dataview_tile;
}(et2_dataview_row));
exports.et2_dataview_tile = et2_dataview_tile;
}
}
//# sourceMappingURL=et2_dataview_view_tile.js.map