]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Switch between plots, dont append scaler prefix if value is 0
authorhadeshyp <hadeshyp>
Tue, 16 Oct 2012 20:42:04 +0000 (20:42 +0000)
committerhadeshyp <hadeshyp>
Tue, 16 Oct 2012 20:42:04 +0000 (20:42 +0000)
cts/htdocs/scripts/base.js

index d81fc99b01e52b11a818462dac4843b89555d5bd..54c7a40a2329cd7c81fc56cf46019329d8ceb6e7 100644 (file)
@@ -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: {},