From 92a0b4dbb5bda069fe41c5f2c7529d5db94eb691 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 7 Nov 2010 23:25:14 +0100 Subject: [PATCH] resolution (tuples) gets automatically determined by screen width --- frontend/javascripts/frontend.js | 6 +++--- frontend/javascripts/init.js | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/javascripts/frontend.js b/frontend/javascripts/frontend.js index b16c720..aa7d8ee 100644 --- a/frontend/javascripts/frontend.js +++ b/frontend/javascripts/frontend.js @@ -49,8 +49,8 @@ vz.wui.init = function() { $('#controls').buttonset(); // tuple resolution - var tup = $('#tuples'); - tup.val(vz.options.tuples).change(function() { + vz.options.tuples = Math.round($('#flot').width() / 3); + $('#tuples').val(vz.options.tuples).change(function() { vz.options.tuples = $(this).val(); vz.entities.loadData(); }); @@ -429,7 +429,7 @@ vz.load = function(context, identifier, data, success) { data: data, error: function(xhr) { json = JSON.parse(xhr.responseText); - vz.errorDialog(xhr.statusText, json.exception.message, xhr.status); // TODO error vs. exception + vz.wui.dialogs.error(xhr.statusText, json.exception.message, xhr.status); // TODO error vs. exception } }); }; diff --git a/frontend/javascripts/init.js b/frontend/javascripts/init.js index acab5f9..ee26c38 100644 --- a/frontend/javascripts/init.js +++ b/frontend/javascripts/init.js @@ -63,7 +63,11 @@ $(document).ready(function() { vz.options.save(); }); - $(window).resize(vz.drawPlot); + $(window).resize(function() { + vz.options.tuples = Math.round($('#flot').width() / 3); + $('#tuples').val(vz.options.tuples); + vz.drawPlot(); + }); // parse uuids & options from cookie vz.uuids.load();