From c77069d0afed948c4450d09236f330f9e222ce06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Mon, 14 Mar 2011 09:36:59 +0000 Subject: [PATCH] Reduced thumbnail filesize limit in egw_vfs_utils.inc.php which was increased for testing purposes, fixed bug with container position calculation in deeper levels in egw_grid_view.js, which affected inserting new grid rows --- phpgwapi/inc/class.egw_vfs_utils.inc.php | 2 +- phpgwapi/js/egw_action/egw_grid_view.js | 42 ++---------------------- 2 files changed, 3 insertions(+), 41 deletions(-) diff --git a/phpgwapi/inc/class.egw_vfs_utils.inc.php b/phpgwapi/inc/class.egw_vfs_utils.inc.php index 262d20e339..4f3a47488c 100644 --- a/phpgwapi/inc/class.egw_vfs_utils.inc.php +++ b/phpgwapi/inc/class.egw_vfs_utils.inc.php @@ -44,7 +44,7 @@ class egw_vfs_utils else if ($file && $mime_main == 'image' && in_array($mime_sub, array('png','jpeg','jpg','gif','bmp')) && (string)$GLOBALS['egw_info']['server']['link_list_thumbnail'] != '0' && (string)$GLOBALS['egw_info']['user']['preferences']['common']['link_list_thumbnail'] != '0' && - (!is_array($value) && ($stat = egw_vfs::stat($file)) ? $stat['size'] : $value['size']) < 4000000) + (!is_array($value) && ($stat = egw_vfs::stat($file)) ? $stat['size'] : $value['size']) < 1500000) { if (substr($file, 0, 6) == '/apps/') { diff --git a/phpgwapi/js/egw_action/egw_grid_view.js b/phpgwapi/js/egw_action/egw_grid_view.js index c27b4f22c6..db595c019a 100644 --- a/phpgwapi/js/egw_action/egw_grid_view.js +++ b/phpgwapi/js/egw_action/egw_grid_view.js @@ -397,11 +397,6 @@ egwGridViewContainer.prototype.setViewArea = function(_area, _force) this.viewArea = relArea; - if (this.containerClass == "grid" && this.grid != null) - { -// console.log(this, _area, this.viewArea); - } - this.checkViewArea(_force); } @@ -435,9 +430,6 @@ egwGridViewContainer.prototype.setPosition = function(_top) /** * Returns the height of the container in pixels and zero if the element is not * visible. The height is clamped to positive values. - * - * TODO: This function consumes 70-80% of the update time! Do something to improve - * this! */ egwGridViewContainer.prototype.getHeight = function() { @@ -559,7 +551,6 @@ function egwGridViewGrid(_grid, _heightChangeProc, _scrollable, _outer) container.avgIconCnt = 1; // Overwrite the abstract container interface functions - container.invalidateHeightCache = egwGridViewGrid_invalidateHeightCache; container.getHeight = egwGridViewGrid_getHeight; container.doInsertIntoDOM = egwGridViewGrid_doInsertIntoDOM; container.doSetViewArea = egwGridViewGrid_doSetviewArea; @@ -763,11 +754,6 @@ function egwGridViewGrid_updateAssumedHeights(_maxCount) // Offset the position of all following elements by the delta. var delta = newHeight - oldHeight; - if (this.grid != null) - { -// console.log(child, delta, newHeight, oldHeight); - } - if (Math.abs(delta) > 0.001) { for (var j = this.updateIndex + 1; j < this.children.length; j++) @@ -923,25 +909,6 @@ function egwGridViewGrid_addContainer(_class) return container; } -function egwGridViewGrid_invalidateHeightCache(_children) -{ - if (typeof _children == "undefined") - { - _children = true; - } - - // Call the inherited function - egwGridViewContainer.prototype.invalidateHeightCache.call(this); - - if (_children) - { - for (var i = 0; i < this.children.length; i++) - { - this.children[i].invalidateHeightCache(); - } - } -} - function egwGridViewGrid_getHeight() { if (this.visible && this.parentNode) @@ -962,16 +929,11 @@ function egwGridViewGrid_heightChangeHandler(_elem) { this.didUpdate = true; - if (this.grid != null) - { -// console.log("HCH for", _elem); - } - // The old height of the element is now only an assumed height - the next // time the "updateAssumedHeights" functions is triggered, this will be // updated. var oldHeight = _elem.assumedHeight !== false ? _elem.assumedHeight : - (_elem.height === false ? this.getOuter().avgRowHeight : _elem.height); + (_elem.height === false ? 0 : _elem.height); _elem.invalidateHeightCache(false); _elem.assumedHeight = oldHeight; @@ -1326,7 +1288,7 @@ function egwGridViewRow_doUpdateData(_immediate) // If the call is not from inside the doInsertIntoDOM function, we have to // inform the parent about a possible height change - if (!_immediate) + if (!_immediate && (this.height || this.assumedHeight)) { this.callHeightChangeProc(); }