Commits

Maciej Fijalkowski committed ea292cd

fix show assembler in case of bridges

Comments (0)

Files changed (2)

_jitviewer/static/script.js

 
-var glob_bridge_state = {};
+var glob_bridge_state = {
+    'asm': false,
+    'op': true,
+};
 
 function show_loop(no, path)
 {
             var elem = arg.callstack[index];
             $('#callstack').append('<div><a href="/" onClick="show_loop(' + no + ', \'' + elem[0] + '\'); return false">' + elem[1] + "</a></div>");
         }
-        $(".asm").hide();
-        $('#asmtoggler').html("Show assembler");
-        $('#optoggler').html("Hide operations");
+        if (!glob_bridge_state.asm) {
+            $(".asm").hide();
+        }
     });
 }
 
                     }
                 }
             }
+            if (!glob_bridge_state.asm) {
+                $(".asm").hide();
+            }
             $.scrollTo($("#loop-" + bridge_id), {axis:'y'});
         });
     });
 }
 
-function toggle(name, clsname, v)
+function asmtoggle()
 {
-    var e = $("#" + name);
-    var e2 = $("." + clsname);
+    var e = $("#asmtoggler");
+    var e2 = $(".asm");
     if (e.html().search("Show") != -1) {
-        e.html("Hide " + v);
+        glob_bridge_state.asm = true;
+        e.html("Hide assembler");
         e2.show();
     } else {
-        e.html("Show " + v);
+        glob_bridge_state.asm = false;
+        e.html("Show assembler");
         e2.hide();
     }
 }

_jitviewer/templates/index.html

 <body>
   <header>
     <span>Menu</span><br/>
-    <a id="optoggler" href="/" onClick="toggle('optoggler', 'operations', 'operations'); return false">Hide operations</a><br/>
-    <a id="asmtoggler" href="/" onClick="toggle('asmtoggler', 'asm', 'assembler'); return false">Show assembler</a>
+    <a id="asmtoggler" href="/" onClick="asmtoggle(); return false">Show assembler</a>
     <div id="callstack">
     </div>
   </header>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.