summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2014-03-11 14:08:22 +0100
committerportix <portix@gmx.net>2014-03-11 14:08:22 +0100
commitfa11b270b416c6060fecec3ace49d8d5f0c092da (patch)
treec23d14bee874771867dcfb54fbf2af5536e9a898
parent75811f623452aef1eeb0764e5509a417c8877dec (diff)
downloaddwb-fa11b270b416c6060fecec3ace49d8d5f0c092da.zip
completion: replacing height with fixedHeight
-rw-r--r--scripts/modules/completion16
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/modules/completion b/scripts/modules/completion
index fdfc9ca4..5e99743f 100644
--- a/scripts/modules/completion
+++ b/scripts/modules/completion
@@ -225,7 +225,7 @@ Object.defineProperties(Completion.prototype, {
else {
widget.inject("clear()");
}
- if (this.height) {
+ if (this.fixedHeight) {
return;
}
var oldHeight = this._height;
@@ -244,13 +244,13 @@ Object.defineProperties(Completion.prototype, {
},
_forward : {
value : function() {
- //this._position++;
+ this._position++;
Completion.widget.inject("select(1)");
}
},
_backward : {
value : function() {
- //this._position--;
+ this._position--;
Completion.widget.inject("select(-1)");
}
},
@@ -296,11 +296,13 @@ Object.defineProperties(Completion.prototype, {
if (this.updateDelay > 0) {
var self = this;
this._timer = timer.start(this.updateDelay, function() {
+ this._position = 0;
self._doUpdate(self.onUpdate(text));
return false;
});
}
else {
+ this._position = 0;
this._doUpdate(this.onUpdate(text));
}
this._lastText = text;
@@ -339,7 +341,8 @@ Object.defineProperties(Completion.prototype, {
});
}
this._doUpdate(this._initialData);
- if (this.height) {
+ if (this.fixedHeight) {
+ widget.heightRequest = Math.min(this.visibleItems) * (this.fontSize + this.lineSpacing);
widget.visible = true;
}
}
@@ -386,9 +389,6 @@ Object.defineProperties(Completion.prototype, {
bind(this.shortcut, this._bindCallback.bind(this));
- if (this.height) {
- Completion.widget.heightRequest = this.height;
- }
if (!this.onUpdate) {
switch (this.match) {
case "lazy" :
@@ -452,6 +452,8 @@ Object.defineProperties(Completion.prototype, {
onHide : { value : function(){}, writable : true },
ignoreCase : { value : true, writable : true },
updateDelay : { value : 0, writable : true },
+ renderItems : { value : 20, writable : true },
+ fixedHeight : { value : false, writable : true },
});
Object.defineProperties(Completion, {