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

Commit

Permalink
RF-13629: Applied the same changes to the height handling as were app…
Browse files Browse the repository at this point in the history
…lied to the width handling in RF-13616
  • Loading branch information
bleathem committed May 15, 2014
1 parent aa2ab4c commit b0eb8e4
Showing 1 changed file with 48 additions and 32 deletions.
Expand Up @@ -329,17 +329,29 @@
this.scrollerDiv.css('width', width + (/px/.test(width) ? '' : 'px'));
}

if (options.height && options.height != -1) {
if (this.currentMinHeight > options.height) {
options.height = this.currentMinHeight;
}
if (options.height > this.maxHeight) {
options.height = this.maxHeight;
if (options.height && options.height != -1 || options.autosized) {
var height;
if (options.autosized) {
height = this.getStyle(this.getContentElement(), "height");
if (this.currentMinHeight > height) {
height = this.currentMinHeight;
}
if (height > this.maxHeight) {
height = this.maxHeight;
}
} else {
if (this.currentMinHeight > options.height) {
options.height = this.currentMinHeight;
}
if (options.height > this.maxHeight) {
options.height = this.maxHeight;
}
height = options.height;
}
$(richfaces.getDomElement(eContentElt)).css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
$(richfaces.getDomElement(eContentElt)).css('height', height + (/px/.test(height) ? '' : 'px'));
var headerHeight = $(richfaces.getDomElement(this.markerId + "_header")) ? $(richfaces.getDomElement(this.markerId + "_header")).innerHeight() : 0;
this.shadowDiv.css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
this.scrollerDiv.css('height', options.height - headerHeight + (/px/.test(options.height) ? '' : 'px'));
this.shadowDiv.css('height', height + (/px/.test(height) ? '' : 'px'));
this.scrollerDiv.css('height', height - headerHeight + (/px/.test(height) ? '' : 'px'));
}

var eIframe;
Expand Down Expand Up @@ -567,6 +579,7 @@

if (this.options.autosized) {
this.resetWidth();
this.resetHeight();
}

newSize = this.getStyle(eContentElt, "width");
Expand Down Expand Up @@ -626,44 +639,36 @@
var oldHeightSize = newSize;
newSize += diff.deltaHeight || 0;

if (newSize >= this.currentMinHeight || this.options.autosized) {
if (diff.deltaHeight) {
cssHashWH.height = newSize + 'px';
shadowHashWH.height = newSize + 'px';
scrollerHashWH.height = newSize - scrollerHeight + 'px';
}
if (newSize >= this.currentMinHeight) {
cssHashWH.height = newSize + 'px';
shadowHashWH.height = newSize + 'px';
scrollerHashWH.height = newSize - scrollerHeight + 'px';
} else {
cssHashWH.height = this.currentMinHeight + 'px';
shadowHashWH.height = this.currentMinHeight + 'px';
scrollerHashWH.height = this.currentMinHeight - scrollerHeight + 'px';

if (diff.deltaHeight) {
cssHashWH.height = this.currentMinHeight + 'px';
shadowHashWH.height = this.currentMinHeight + 'px';
scrollerHashWH.height = this.currentMinHeight - scrollerHeight + 'px';
vetoes.vy = oldHeightSize - this.currentMinHeight;
vetoes.y = true;
}

vetoes.y = true;
}

if (newSize > this.options.maxHeight) {
cssHashWH.height = this.options.maxHeight + 'px';
shadowHashWH.height = this.options.maxHeight + 'px';
scrollerHashWH.height = this.options.maxHeight - scrollerHeight + 'px';

if (diff.deltaHeight) {
cssHashWH.height = this.currentMaxHeight + 'px';
shadowHashWH.height = this.currentMaxHeight + 'px';
scrollerHashWH.height = this.currentMaxHeight - scrollerHeight + 'px';
vetoes.vy = oldHeightSize - this.currentMaxHeight;
vetoes.vy = oldHeightSize - this.options.maxHeight;
vetoes.y = true;
}

vetoes.y = true;
}

if (vetoes.vy && diff.deltaY) {
diff.deltaY = -vetoes.vy;
}

if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
if (vetoes.vy) {
diff.deltaY = vetoes.vy;
}

}
if (diff.deltaY && (vetoes.vy || !vetoes.y)) {
if (vetoes.vy) {
diff.deltaY = vetoes.vy;
Expand All @@ -673,6 +678,7 @@
newTopPos += diff.deltaY;
cssHash.top = newTopPos + 'px';
}

eContentElt.css(cssHashWH);
this.scrollerDiv.css(scrollerHashWH);
if (this.eIframe) {
Expand Down Expand Up @@ -720,6 +726,16 @@
$(this.cdiv).css('width', '');
},

resetHeight: function() {
this.getContentElement().css('height', '');
this.scrollerDiv.css('height', '');
if (this.eIframe) {
this.eIframe.css('height', '');
}
this.shadowDiv.css('height', '');
$(this.cdiv).css('height', '');
},

setSize : function (width, height) {
var w = width - this.width();
var h = height - this.height();
Expand Down

0 comments on commit b0eb8e4

Please sign in to comment.