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