From 2452858853cc35bf4abd5824445e1f2440ee4d6b Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Wed, 19 Feb 2014 11:28:48 +0100 Subject: [PATCH] Fix globals. Fix init --- js/models.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/models.js b/js/models.js index 7cb4a4b..ee38cd7 100644 --- a/js/models.js +++ b/js/models.js @@ -328,10 +328,8 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter) var BufferList = []; - activeBuffer = null; - previousBuffer = null; - unreads = 0; - notifications = 0; + var activeBuffer = null; + var previousBuffer = null; this.model = { 'buffers': {} }; @@ -344,7 +342,7 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter) this.addBuffer = function(buffer) { BufferList[buffer.id] = buffer; if (BufferList.length === 1) { - activeBuffer = buffer.id; + activeBuffer = buffer; } this.model.buffers[buffer.id] = buffer; };