diff options
author | portix <portix@gmx.net> | 2014-03-11 00:09:43 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2014-03-11 00:09:43 +0100 |
commit | 042e4b08f7a0533e97f163dfcb745e355fc23a76 (patch) | |
tree | 1b5a6c0ec472f2fdc08c5b8d8643df903ed06225 | |
parent | b207c8629e0dadfdb68f44b3ec8bad926c4b8d8c (diff) | |
download | dwb-042e4b08f7a0533e97f163dfcb745e355fc23a76.zip |
completion: remove unused function getLineHeight
-rw-r--r-- | scripts/modules/completion | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/scripts/modules/completion b/scripts/modules/completion index 0a97fc10..57eb9e6f 100644 --- a/scripts/modules/completion +++ b/scripts/modules/completion @@ -95,17 +95,17 @@ function injectable() { function update(data) { clear(); var content = document.createDocumentFragment(); - mElements = data.map(function(tab, i) { + mElements = data.map(function(item, i) { var className = "line "; var element = createElement("div", content, { className : "line", }); - createElement("div", element, { - textContent : tab.leftLabel || "", + createElement("code", element, { + textContent : item.leftLabel || "", className : "label left" }); - createElement("div", element, { - textContent : tab.rightLabel || "", + createElement("code", element, { + textContent : item.rightLabel || "", className : "label right" }); element.dataset.id = i; @@ -126,18 +126,6 @@ function injectable() { } } } - function getLineHeight(style) { - applyStyle(styles); - var textl = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - var textr = "asdfefghijklmnopqrstuvz1234567890"; - var line = createElement("div", document.getElementById("content"), { - className : "line" - }); - createElement("div", line, { className : "lineLeft" }); - createElement("div", line, { className : "lineRight" }); - var style = window.getComputedStyle(element, null); - alert(style.height); - } } function getWidget() { @@ -171,6 +159,7 @@ function Completion(args) { } util.mixin(this, args); + io.print(this.fontFamily); this._startup(); } @@ -184,6 +173,7 @@ Object.defineProperties(Completion.prototype, { _data : { value : null, writable : true }, _height : { value : 0, writable : true }, _initialData : { value : null, writable : true }, + _position : { value : 0, writable : true }, _cleanup : { value : function() { @@ -201,6 +191,8 @@ Object.defineProperties(Completion.prototype, { this._height = 0; this._lastText = ""; this._data = null; + this._initialData = null; + this._position = 0; util.normalMode(); } }, @@ -243,6 +235,19 @@ Object.defineProperties(Completion.prototype, { } } }, + _forward : { + value : function() { + //this._position++; + Completion.widget.inject("select(1)"); + } + }, + _backward : { + value : function() { + //this._position--; + Completion.widget.inject("select(-1)"); + } + }, + _onKeyPress : { value : function(w, e) { switch(e.name) { @@ -255,11 +260,11 @@ Object.defineProperties(Completion.prototype, { return true; case "Down" : case "Tab" : - Completion.widget.inject("select(1)"); + this._forward(); return true; case "Up" : case "ISO_Left_Tab" : - Completion.widget.inject("select(-1)"); + this._backward(); return true; default : return false; @@ -322,6 +327,7 @@ Object.defineProperties(Completion.prototype, { }, _startup : { value : function() { + var styleId; var style = JSON.stringify({ body : { "background-color" : this.bgColor || settings.normalCompletionBgColor, @@ -346,12 +352,15 @@ Object.defineProperties(Completion.prototype, { }); if (!Completion._styles.some(function(s, i) { if (s == style) { - this._styleId = i; + styleId = i; return true; } }, this)) { - this._styleId = Completion._styles.push(style) - 1; + styleId = Completion._styles.push(style) - 1; } + Object.defineProperty(this, "_styleId", { value : styleId }); + + //this.renderedItems = this.renderedItems || this.visibleItems * 3; this._sigKeyPress = Signal("keyPress", this._onKeyPress.bind(this)); this._sigKeyRelease = Signal("keyRelease", this._onKeyRelease.bind(this)); |