Support close buffer
This commit is contained in:
parent
1404c04590
commit
019f1ce585
2 changed files with 5 additions and 9 deletions
|
@ -48,9 +48,10 @@ models.service('models', ['colors', function(colors) {
|
|||
}
|
||||
|
||||
this.closeBuffer = function(bufferId) {
|
||||
delete(BufferList[bufferId]);
|
||||
var firstBuffer = _.keys(BufferList)[0];
|
||||
activeBuffer = firstBuffer;
|
||||
|
||||
delete(this.model['buffers'][bufferId.id]);
|
||||
var firstBuffer = _.keys(this.model['buffers'])[0];
|
||||
this.setActiveBuffer(firstBuffer);
|
||||
}
|
||||
|
||||
this.Buffer = function(message) {
|
||||
|
|
|
@ -196,7 +196,7 @@ weechat.factory('handlers', ['$rootScope', 'colors', 'models', 'pluginManager',
|
|||
var handleBufferClosing = function(message) {
|
||||
var bufferMessage = message['objects'][0]['content'][0];
|
||||
var buffer = new models.Buffer(bufferMessage);
|
||||
$rootScope.closeBuffer(buffer.id);
|
||||
models.closeBuffer(buffer);
|
||||
}
|
||||
|
||||
var handleBufferLineAdded = function(message) {
|
||||
|
@ -388,11 +388,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', 'models', '
|
|||
// TODO checkbox for saving password or not?
|
||||
// $scope.password = "";
|
||||
|
||||
$rootScope.closeBuffer = function(buffer_pointer) {
|
||||
// delete($rootScope.buffers[buffer_pointer]);
|
||||
// var first_buffer = _.keys($rootScope.buffers)[0];
|
||||
// $scope.setActiveBuffer(first_buffer);
|
||||
}
|
||||
|
||||
$scope.setActiveBuffer = function(key) {
|
||||
console.log(key);
|
||||
|
|
Loading…
Reference in a new issue