From a8fa0b81461813fbb261c901c9e1fb33cb854651 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Thu, 3 May 2012 13:11:45 +0200 Subject: [PATCH] candidatePanel: Use the Lang.Class framework --- js/ui/status/candidatePanel.js | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/js/ui/status/candidatePanel.js b/js/ui/status/candidatePanel.js index deb4ddd02..fd95da286 100644 --- a/js/ui/status/candidatePanel.js +++ b/js/ui/status/candidatePanel.js @@ -34,11 +34,9 @@ const ORIENTATION_HORIZONTAL = 0; const ORIENTATION_VERTICAL = 1; const ORIENTATION_SYSTEM = 2; -function StCandidateArea(orientation) { - this._init(orientation); -} +const StCandidateArea = new Lang.Class({ + Name: 'StCandidateArea', -StCandidateArea.prototype = { _init: function(orientation) { this.actor = new St.BoxLayout({ style_class: 'candidate-area' }); this._orientation = orientation; @@ -210,15 +208,12 @@ StCandidateArea.prototype = { hideAll: function() { this.actor.hide(); }, -}; - +}); Signals.addSignalMethods(StCandidateArea.prototype); -function CandidatePanel() { - this._init(); -} +const CandidatePanel = new Lang.Class({ + Name: 'CandidatePanel', -CandidatePanel.prototype = { _init: function() { this._orientation = ORIENTATION_VERTICAL; this._currentOrientation = this._orientation; @@ -585,6 +580,5 @@ CandidatePanel.prototype = { move: function(x, y) { this.actor.set_position(x, y); } -}; - +}); Signals.addSignalMethods(CandidatePanel.prototype);