|
|
@ -90,6 +90,7 @@ Ext.ux.MumbleChannelViewer = function( config ){ |
|
|
|
title: gettext("Channel Viewer"), |
|
|
|
refreshInterval: 30000, |
|
|
|
idleInterval: 2, |
|
|
|
usersAboveChannels: false, |
|
|
|
autoScroll: true, |
|
|
|
enableDD: false, // Users need to enable this explicitly
|
|
|
|
root: { |
|
|
@ -200,6 +201,7 @@ Ext.extend( Ext.ux.MumbleChannelViewer, Ext.tree.TreePanel, { |
|
|
|
tree = this; |
|
|
|
function populateNode( node, json ){ |
|
|
|
var subchan_users = 0; |
|
|
|
var popChannels = function(){ |
|
|
|
json.channels.sort(cmp_channels); |
|
|
|
for( var i = 0; i < json.channels.length; i++ ){ |
|
|
|
var child = { |
|
|
@ -218,6 +220,8 @@ Ext.extend( Ext.ux.MumbleChannelViewer, Ext.tree.TreePanel, { |
|
|
|
node.children.push( child ); |
|
|
|
subchan_users += populateNode( child, json.channels[i] ); |
|
|
|
} |
|
|
|
} |
|
|
|
var popUsers = function(){ |
|
|
|
json.users.sort(cmp_names); |
|
|
|
for( var i = 0; i < json.users.length; i++ ){ |
|
|
|
var child = { |
|
|
@ -238,6 +242,15 @@ Ext.extend( Ext.ux.MumbleChannelViewer, Ext.tree.TreePanel, { |
|
|
|
node.leaf = false; |
|
|
|
node.children.push( child ); |
|
|
|
} |
|
|
|
} |
|
|
|
if( tree.usersAboveChannels ){ |
|
|
|
popUsers(); |
|
|
|
popChannels(); |
|
|
|
} |
|
|
|
else{ |
|
|
|
popChannels(); |
|
|
|
popUsers(); |
|
|
|
} |
|
|
|
if( json.id == 0 || json.users.length > 0 || subchan_users ) |
|
|
|
node.expanded = true; |
|
|
|
return subchan_users + json.users.length; |
|
|
|