diff options
author | portix <portix@gmx.net> | 2014-03-12 04:13:58 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2014-03-12 04:13:58 +0100 |
commit | c9b2ee6724677737998a87ed85b4487430e127ba (patch) | |
tree | 6a294c635eccc6f24a73fd28c5f42bd0218b71dc | |
parent | 005f0d07d1e422e1898b8469ea099018410db6f8 (diff) | |
download | dwb-c9b2ee6724677737998a87ed85b4487430e127ba.zip |
completion: Remove unnecessary Math.min when computing fixed height
-rw-r--r-- | scripts/modules/completion | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/modules/completion b/scripts/modules/completion index 2a32fb36..6aa1aebc 100644 --- a/scripts/modules/completion +++ b/scripts/modules/completion @@ -278,13 +278,14 @@ Object.defineProperties(Completion.prototype, { this._height = Math.min(this._data.length, this.visibleItems) * (this.fontSize + this.lineSpacing); if (this._height == 0) { widget.visible = false; - return; - } - if (oldHeight != this._height) { - widget.heightRequest = this._height; } - if (oldHeight == 0) { - widget.visible = true; + else { + if (oldHeight != this._height) { + widget.heightRequest = this._height; + } + if (oldHeight == 0) { + widget.visible = true; + } } } }, @@ -400,7 +401,7 @@ Object.defineProperties(Completion.prototype, { this.refresh(); if (this.fixedHeight) { - widget.heightRequest = Math.min(this.visibleItems) * (this.fontSize + this.lineSpacing); + widget.heightRequest = this.visibleItems * (this.fontSize + this.lineSpacing); widget.visible = true; } } |