diff --git a/js/glowingbear.js b/js/glowingbear.js index 7a3b2da..9ef90b0 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -497,6 +497,13 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.mobile_cutoff = 968; + // Focuses itself when active buffer is changed + $rootScope.$on('activeBufferChanged', function() { + if (document.body.clientWidth >= $scope.mobile_cutoff) { + $('#sendMessage').focus(); + } + }); + $rootScope.countWatchers = function () { var root = $(document.getElementsByTagName('body')); var watchers = []; @@ -1007,23 +1014,17 @@ weechat.directive('inputBar', function() { return { templateUrl: 'directives/input.html', + scope: { inputId: '@inputId', }, + controller: function($rootScope, $scope, $element, connection, models) { - // Focuses itself when active buffer is changed - $rootScope.$on('activeBufferChanged', function() { - if (document.body.clientWidth >= $scope.mobile_cutoff) { - angular.element('#sendMessage').focus(); - } - }); - - /* * Returns the input element */