Remove global variables

This commit is contained in:
David Cormier 2013-12-16 08:20:31 -05:00
parent d5366c9918
commit 27dbb1fc83

View file

@ -240,7 +240,7 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
* @param reason reason for failure * @param reason reason for failure
*/ */
failCallbacks = function(reason) { failCallbacks = function(reason) {
for(i in callbacks) { for(var i in callbacks) {
callbacks[i].cb.reject(reason); callbacks[i].cb.reject(reason);
} }
@ -268,7 +268,7 @@ weechat.factory('connection', ['$q', '$rootScope', '$log', '$store', 'handlers',
*/ */
var sendAll = function(messages) { var sendAll = function(messages) {
var promises = []; var promises = [];
for(i in messages) { for(var i in messages) {
var promise = send(messages[i]); var promise = send(messages[i]);
promises.push(promise); promises.push(promise);
} }
@ -689,7 +689,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$rootScope.switchToActivityBuffer = function() { $rootScope.switchToActivityBuffer = function() {
// Find next buffer with activity and switch to it // Find next buffer with activity and switch to it
for(i in $scope.buffers) { for(var i in $scope.buffers) {
var buffer = $scope.buffers[i]; var buffer = $scope.buffers[i];
if(buffer.notification > 0) { if(buffer.notification > 0) {
$scope.setActiveBuffer(buffer.id); $scope.setActiveBuffer(buffer.id);