@@ -50,21 +50,36 @@ $( document ).ready(function() {
5050
5151 // Attach event listeners to the toggling between assembly and script
5252 $ ( "body" ) . delegate ( "#editor-tab-assembly" , "click" , function ( ) {
53- if ( ! $ ( "#editor" ) . hasClass ( "assembly" ) ) {
54- var script = editor . getSession ( ) . getValue ( ) ;
55- editor . setValue ( assembleToHex ( script ) , - 1 ) ; //-1 for cursor at start, 1 for end
56- $ ( "#editor" ) . addClass ( "assembly" ) ;
57- $ ( "#editor" ) . removeClass ( "script" ) ;
58- }
53+ // if(!$("#editor").hasClass("assembly")) {
54+ // var script = editor.getSession().getValue();
55+ // editor.setValue(assembleToHex(script), -1); //-1 for cursor at start, 1 for end
56+ // $("#editor").addClass("assembly");
57+ // $("#editor").removeClass("script");
58+ // }
59+ var script = editor . getSession ( ) . getValue ( ) ;
60+ editorAssembly . setValue ( assembleToHex ( script ) , - 1 ) ; //-1 for cursor at start, 1 for end
61+
62+ $ ( "#editor-section div.tab-area" ) . removeClass ( "active" ) . addClass ( "inactive" ) ;
63+ $ ( "#editor-assembly-holder.tab-area" ) . removeClass ( "inactive" ) . addClass ( "active" ) ;
5964 } ) ;
6065
6166 $ ( "body" ) . delegate ( "#editor-tab-script" , "click" , function ( ) {
62- if ( ! $ ( "#editor" ) . hasClass ( "script" ) ) {
63- var hex = editor . getSession ( ) . getValue ( ) ;
64- editor . setValue ( disassembleFromHex ( hex ) , - 1 ) ; //-1 for cursor at start, 1 for end
65- $ ( "#editor" ) . addClass ( "script" ) ;
66- $ ( "#editor" ) . removeClass ( "assembly" ) ;
67- }
67+ // if(!$("#editor").hasClass("script")) {
68+ // var hex = editor.getSession().getValue();
69+ // editor.setValue(disassembleFromHex(hex), -1); //-1 for cursor at start, 1 for end
70+ // $("#editor").addClass("script");
71+ // $("#editor").removeClass("assembly");
72+ // }
73+ var hex = editorAssembly . getSession ( ) . getValue ( ) ;
74+ editor . setValue ( disassembleFromHex ( hex ) , - 1 ) ; //-1 for cursor at start, 1 for end
75+
76+ $ ( "#editor-section div.tab-area" ) . removeClass ( "active" ) . addClass ( "inactive" ) ;
77+ $ ( "#editor-holder.tab-area" ) . removeClass ( "inactive" ) . addClass ( "active" ) ;
78+ } ) ;
79+
80+ $ ( "body" ) . delegate ( "#editor-tab-options" , "click" , function ( ) {
81+ $ ( "#editor-section div.tab-area" ) . removeClass ( "active" ) . addClass ( "inactive" ) ;
82+ $ ( "#editor-options.tab-area" ) . removeClass ( "inactive" ) . addClass ( "active" ) ;
6883 } ) ;
6984
7085 $ ( "#editor-section" ) . on ( "mouseover" , function ( ) {
0 commit comments