From 440530a67a610116a2a3da262bf1b7b30fd5491c Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 27 Dec 2012 18:00:56 +0100 Subject: Don't do any unnecessary work in init --- extension.js | 11 ++++++----- 1 file 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(); } -- cgit v1.2.3