From: hadeshyp Date: Tue, 16 Oct 2012 20:42:04 +0000 (+0000) Subject: Switch between plots, dont append scaler prefix if value is 0 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=2aa8d8d7caf4cc40a916f0ec5b745a876e1c88c2;p=daqtools.git Switch between plots, dont append scaler prefix if value is 0 --- diff --git a/cts/htdocs/scripts/base.js b/cts/htdocs/scripts/base.js index d81fc99..54c7a40 100644 --- a/cts/htdocs/scripts/base.js +++ b/cts/htdocs/scripts/base.js @@ -691,7 +691,7 @@ function appendScalingPrefix(val, sigDigits) { if (sigDigits === undefined) sigDigits = 2; - while(pref.length) { + while(val && pref.length) { scale = pref.shift(); name = pref.shift(); @@ -742,6 +742,19 @@ function formatAddress(x) { return "0x" + hex; } +window.addEvent('domready', function() { + $('rate-plot').addEvent('click', function() { + var i = $('rate-plot'); + u = i.get('src'); + if (u.test('short')) + u = u.replace('short', ''); + else + u = u.replace('plot.', 'plotshort.'); + + i.set('src', u); + }); +}); + var GuiExpander = new Class({ boxes: null, states: {},