aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-12-27 18:00:56 +0100
committerGuido Günther <agx@sigxcpu.org>2012-12-27 18:01:47 +0100
commit440530a67a610116a2a3da262bf1b7b30fd5491c (patch)
tree7d126dd2cffbdb27952fd3aa2d0ebb622ea767dc
parent95693d25d08d6c85b86fac21ee37657afd96e20c (diff)
Don't do any unnecessary work in init
-rw-r--r--extension.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/extension.js b/extension.js
index 55ddfdf..65ab61e 100644
--- a/extension.js
+++ b/extension.js
@@ -51,13 +51,13 @@ OnScreenKeyboardButton.prototype = {
}
},
- connect: function() {
+ enable: function() {
let _children = Main.panel._centerBox.get_children();
Main.panel._centerBox.insert_child_at_index(this.actor, _children.length - 1);
Main.panel._centerBox.add(this.actor);
},
- disconnect: function() {
+ disable: function() {
Main.layoutManager.connect(this._keyboardVisibleId);
Main.panel._centerBox.remove_actor(_button.actor);
},
@@ -66,13 +66,14 @@ OnScreenKeyboardButton.prototype = {
let _button;
function init() {
- _button = new OnScreenKeyboardButton();
+ /* do nothing */
}
function enable() {
- _button.connect()
+ _button = new OnScreenKeyboardButton();
+ _button.enable();
}
function disable() {
- _button.disconnect();
+ _button.disable();
}