Skip to content

Commit

Permalink
give up on trying to use only the chart area for drawers (for now) on…
Browse files Browse the repository at this point in the history
… some screen sizes since the android keyboard messes it up
  • Loading branch information
jasoncalabrese committed Feb 17, 2016
1 parent 0fbf6ef commit 9aab137
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
18 changes: 9 additions & 9 deletions lib/client/browser-utils.js
Expand Up @@ -97,17 +97,17 @@ function init ($) {

var windowWidth = $(window).width();
var windowHeight = $(window).height();
var chartTop = $('#chartContainer').offset().top - 45;
var chartHeight = windowHeight - chartTop - 45;
//var chartTop = $('#chartContainer').offset().top - 45;
//var chartHeight = windowHeight - chartTop - 45;
if (windowWidth < SMALL_SCREEN || (windowHeight < SMALL_SCREEN) && windowWidth < 800) {
style.top = '0px';
style.height = windowHeight + 'px';
style.width = windowWidth + 'px';
if (chartHeight > windowHeight * 0.4) {
style.top = chartTop + 'px';
style.height = chartHeight + 'px';
} else {
style.top = '0px';
style.height = windowHeight + 'px';
}
//TODO: maybe detect iOS and do this, doesn't work good with android
//if (chartHeight > windowHeight * 0.4) {
// style.top = chartTop + 'px';
// style.height = chartHeight + 'px';
//}
} else {
style.top = '0px';
style.height = (windowHeight - 45) + 'px';
Expand Down
8 changes: 6 additions & 2 deletions lib/client/chart.js
Expand Up @@ -237,9 +237,13 @@ function init (client, d3, $) {
var currentBrushExtent = createAdjustedRange();

// only redraw chart if chart size has changed
if ((chart.prevChartWidth !== chartWidth) || (chart.prevChartHeight !== chartHeight)) {
var widthChanged = (chart.prevChartWidth !== chartWidth);
if (widthChanged || (chart.prevChartHeight !== chartHeight)) {

client.browserUtils.closeLastOpenedDrawer();
//if rotated
if (widthChanged) {
client.browserUtils.closeLastOpenedDrawer();
}

chart.prevChartWidth = chartWidth;
chart.prevChartHeight = chartHeight;
Expand Down

0 comments on commit 9aab137

Please sign in to comment.