From 581c28bab69cd4938fff0b5b284b2b8f997dc1ee Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 23 Mar 2012 09:22:03 +0000 Subject: [PATCH] handle statistics dialog resize, fixes #710 --- static/js/pandora/statisticsDialog.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/static/js/pandora/statisticsDialog.js b/static/js/pandora/statisticsDialog.js index d8f132a3..db65ec9e 100644 --- a/static/js/pandora/statisticsDialog.js +++ b/static/js/pandora/statisticsDialog.js @@ -75,7 +75,18 @@ pandora.ui.statisticsDialog = function() { removeOnClose: true, title: 'Statistics', width: dialogWidth - }); + }) + .bindEvent({ + resizeend: function(data) { + dialogWidth = data.width; + Ox.print('WIDTH:::', dialogWidth) + $tabPanel.$element.replaceElement(1, + $tabPanel.options('content')($tabPanel.selected()) + ); + } + }), + + $tabPanel; //Ox.getJSON('/static/json/deleteme.json', function(result) { pandora.api.findUsers({ @@ -84,11 +95,9 @@ pandora.ui.statisticsDialog = function() { sort: [{key: 'username', operator: '+'}] }, function(result) { - var chartWidth = dialogWidth - 32 - Ox.UI.SCROLLBAR_SIZE, - data = {}, + var data = {}, flagCountry = {}, - $guestsCheckbox, - $tabPanel; + $guestsCheckbox; ['all', 'registered'].forEach(function(mode) { @@ -226,7 +235,8 @@ pandora.ui.statisticsDialog = function() { $tabPanel = Ox.TabPanel({ content: function(id) { - var mode = $guestsCheckbox.options('value') ? 'all' : 'registered', + var chartWidth = dialogWidth - 32 - Ox.UI.SCROLLBAR_SIZE, + mode = $guestsCheckbox.options('value') ? 'all' : 'registered', top = 16, $content = Ox.Element() .css({