From 3ad76d2ff39dd578d0da27e0213aa3c8c03c21ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sun, 20 Apr 2014 17:44:50 +0200 Subject: [PATCH] Don't ng-repeat function calls, they're expensive See http://tech.small-improvements.com/2013/09/10/angularjs-performance-with-large-lists/ --- index.html | 4 ++-- js/glowingbear.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index c99e115..ea4139b 100644 --- a/index.html +++ b/index.html @@ -221,7 +221,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
-
    +
    • @@ -236,7 +236,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel - + diff --git a/js/glowingbear.js b/js/glowingbear.js index a8c8f94..5006e65 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -654,6 +654,8 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $rootScope.$on('activeBufferChanged', function(event, unreadSum) { var ab = models.getActiveBuffer(); + $scope.bufferlines = ab.lines; + $scope.nicklist = ab.nicklist; if (ab.requestedLines < $scope.lines) { // buffer has not been loaded, but some lines may already be present if they arrived after we connected @@ -719,14 +721,15 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.buffers = models.model.buffers; + $scope.bufferlines = {}; + $scope.nicklist = {}; + $scope.activeBuffer = models.getActiveBuffer; $rootScope.waseverconnected = false; $rootScope.models = models; - $rootScope.buffer = []; - $rootScope.iterCandidate = null; $store.bind($scope, "host", "localhost");