From fb0ce21fc5c97f199f1421c8bdfb95b30b49b8f7 Mon Sep 17 00:00:00 2001 From: David Cormier Date: Sat, 12 Oct 2013 16:07:46 -0400 Subject: [PATCH] models: add activeBufferChanged signal When the active buffer is changed on the model, the model now emits a signal on the rootScope --- js/models.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/models.js b/js/models.js index ceb4808..a505b81 100644 --- a/js/models.js +++ b/js/models.js @@ -4,7 +4,7 @@ */ var models = angular.module('weechatModels', []); -models.service('models', ['colors', function(colors) { +models.service('models', ['$rootScope', 'colors', function($rootScope, colors) { /* * Buffer class */ @@ -84,7 +84,7 @@ models.service('models', ['colors', function(colors) { rtext = content[0]['text']; } - return { + return { prefix: prefix, content: content, date: date, @@ -160,9 +160,12 @@ models.service('models', ['colors', function(colors) { return buffer; } }); + activeBuffer.notification = false; activeBuffer.active = true; activeBuffer.unread = ''; + + $rootScope.$emit('activeBufferChanged'); } /*