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 1/2] 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"); From b4e1a5aaad867dce51016d8d995f3c8686a38d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sun, 20 Apr 2014 17:59:52 +0200 Subject: [PATCH 2/2] Minimise usage of ng-show/hide to reduce number of useless DOM elements Progress in the direction of #87, especially on mobile. --- index.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index ea4139b..59ba872 100644 --- a/index.html +++ b/index.html @@ -33,7 +33,7 @@ -
      +

      logo glowing bear @@ -189,7 +189,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel brand - +

      @@ -203,7 +203,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
      -