Index: branches/RC/core/admin_templates/incs/blocks.tpl
===================================================================
diff -u -N -r8929 -r10865
--- branches/RC/core/admin_templates/incs/blocks.tpl (.../blocks.tpl) (revision 8929)
+++ branches/RC/core/admin_templates/incs/blocks.tpl (.../blocks.tpl) (revision 10865)
@@ -12,11 +12,13 @@
-
-
+
+
+
+
Index: branches/RC/core/admin_templates/js/grid_scroller.js
===================================================================
diff -u -N -r10863 -r10865
--- branches/RC/core/admin_templates/js/grid_scroller.js (.../grid_scroller.js) (revision 10863)
+++ branches/RC/core/admin_templates/js/grid_scroller.js (.../grid_scroller.js) (revision 10865)
@@ -156,8 +156,55 @@
this.MaxHeaderHeights = [50,30];
this.MaxRowHeight = 45;
+
+ this.Html = ''; // html from last grid rendering
}
+GridScroller.prototype._getMeasureHtml = function() {
+ return '
';
+}
+
+GridScroller.prototype._prepareHtml = function($container) {
+ if (typeof($container) == 'undefined') {
+ var dot = this._getMeasureHtml();
+// console.log('dot without container');
+ document.write(dot);
+ }
+ else {
+// console.log('dot inside container');
+ var dot = document.createElement('div');
+ dot.id = 'my_measure_'+this.GridId;
+ dot.style.width = 'auto';
+ dot.style.height = '0px';
+ dot.style.zIndex = '-105';
+ document.getElementById($container).appendChild(dot);
+ }
+
+ var dot = document.getElementById('my_measure_'+this.GridId);
+ var measure = document.getElementById('my_measure_'+this.GridId);
+ this.pos = findPos(dot);
+// alert('dot: '+this.pos[0]+','+this.pos[1])
+ var collapse_correction = this._getCollapseCorrection();
+ if (is.ie) this.pos[0] += 1;
+
+// this.MainOuter.style.width = 'auto'
+ var w = measure.offsetWidth;
+ var h = document.body.clientHeight;
+ var dim = getDimensions(measure);
+ h -= this.pos[1] + dim.padding[0] + dim.padding[2] + dim.borders[0] + dim.borders[2] + this.BottomOffset;
+ var $html = this.AltHTML(this.pos[0],this.pos[1], w, h);
+
+ if (typeof($container) !== 'undefined') {
+ $html = this._getMeasureHtml() + $html;
+ }
+
+ return $html;
+}
+
+GridScroller.prototype._getCollapseCorrection = function() {
+ return is.ie ? 0 : -1;
+}
+
GridScroller.prototype.Render = function(id)
{
ResetStart();
@@ -170,33 +217,36 @@
document.body.style.overflow = 'hidden';
document.body.scroll = 'no'
- // html = this.AltHTML();
+ // this.Html = this.AltHTML();
// Profile('Getting HTML',1);
+// console.log('GridScroller.Render(', id, ')');
if (id && id != '') {
- document.getElementById(id).innerHTML = ''+html+'
';
+// console.log('id given');
+ if (this.Html.length == 0) {
+ // 1st render and inside container -> prepare html
+// console.log('1st render and no html');
+ this.Html = this._prepareHtml(id);
+
+ var collapse_correction = this._getCollapseCorrection();
+ document.getElementById(id).innerHTML = ''+this.Html+'
';
+ }
+ else {
+ document.getElementById(id).innerHTML = ''+this.Html+'
';
+ }
execJS(document.getElementById(id))
}
else {
+// console.log('id not given');
if (this.Rendered) {
+// console.log('rendering inside container');
this.Render('main_div_'+this.GridId);
return;
}
- var dot = '';
- document.write(dot);
- var dot = document.getElementById('my_measure_'+this.GridId);
- var measure = document.getElementById('my_measure_'+this.GridId);
- this.pos = findPos(dot);
-// alert('dot: '+this.pos[0]+','+this.pos[1])
- var collapse_correction = is.ie ? 0 : -1;
- if (is.ie) this.pos[0] += 1;
-// this.MainOuter.style.width = 'auto'
- var w = measure.offsetWidth;
- var h = document.body.clientHeight;
- var dim = getDimensions(measure);
- h -= this.pos[1] + dim.padding[0] + dim.padding[2] + dim.borders[0] + dim.borders[2] + this.BottomOffset;
- html = this.AltHTML(this.pos[0],this.pos[1], w, h);
- document.write(''+html+'
');
+// console.log('just rendering');
+ this.Html = this._prepareHtml();
+ var collapse_correction = this._getCollapseCorrection();
+ document.write(''+this.Html+'
');
}
this.Rendered = true;
// Profile('Main render & refs',1)
@@ -267,9 +317,17 @@
}
}
- addLoadEvent( function() {the_grid.AutoResize(); the_grid.SetResizeHandles();} );
+ addLoadEvent(
+ function() {
+ the_grid.afterLoad();
+ }
+ );
}
+GridScroller.prototype.afterLoad = function() {
+ this.AutoResize();
+ this.SetResizeHandles();
+}
GridScroller.prototype.SetReferences = function() {
this.MainOuter = document.getElementById('outer_main_'+this.GridId );
@@ -684,6 +742,10 @@
this.MainOuter.style.width = 'auto'
var w = this.MainInner.offsetWidth;
+ if (!isset(h)) {
+ h = 'auto';
+ }
+
if (h == 'auto') {
var h = document.body.clientHeight;