@@ -391,23 +391,6 @@ $.when($.getScript("js/global/global.js")
391391 $ ( "a[name='" + tabactive + "']" ) . click ( ) ;
392392 }
393393
394- $ ( "a[name='tabProperties']" ) . on ( "shown.bs.tab" , function ( e ) {
395- e . target ; // newly activated tab
396- e . relatedTarget ; // previous active tab
397- InsertURLInHistory ( "./TestCaseScript.jsp?" + ReplaceURLParameters ( "tabactive" , "tabProperties" ) ) ;
398-
399- } )
400- $ ( "a[name='tabSteps']" ) . on ( "shown.bs.tab" , function ( e ) {
401- e . target ; // newly activated tab
402- e . relatedTarget ; // previous active tab
403- InsertURLInHistory ( "./TestCaseScript.jsp?" + ReplaceURLParameters ( "tabactive" , "tabSteps" ) ) ;
404- } )
405- $ ( "a[name='tabInheritedProperties']" ) . on ( "shown.bs.tab" , function ( e ) {
406- e . target ; // newly activated tab
407- e . relatedTarget ; // previous active tab
408- InsertURLInHistory ( "./TestCaseScript.jsp?" + ReplaceURLParameters ( "tabactive" , "tabInheritedProperties" ) ) ;
409- } )
410-
411394 }
412395 // close all Navbar menu
413396 //closeEveryNavbarMenu();
@@ -671,7 +654,7 @@ function saveScript(queueid = 0, tag = "") {
671654 var stepHtml = $ ( "#steps li.active" ) ;
672655 var stepData = stepHtml . data ( "item" ) ;
673656
674- var tabActive = $ ( "#tabsScriptEdit li.active a" ) . attr ( "name" ) ;
657+ const tabActive = GetURLParameter ( 'tabactive' ) || 'steps' ;
675658
676659 var parser = document . createElement ( 'a' ) ;
677660 parser . href = window . location . href ;
@@ -1959,4 +1942,34 @@ function tec_keyispressed(e) {
19591942 return false ;
19601943 }
19611944 return true ;
1945+ }
1946+
1947+ function testCaseScript ( ) {
1948+ return {
1949+ tab : 'steps' ,
1950+
1951+ init ( ) {
1952+ const fromURL = GetURLParameter ( "tabactive" ) ;
1953+
1954+ if ( fromURL ) {
1955+ this . setTab ( fromURL ) ;
1956+ }
1957+
1958+ this . updateHistory ( this . tab ) ;
1959+ } ,
1960+
1961+ setTab ( name ) {
1962+ this . tab = name ;
1963+ this . updateHistory ( name ) ;
1964+ } ,
1965+
1966+ getActiveTab ( ) {
1967+ return this . tab ;
1968+ } ,
1969+
1970+ updateHistory ( tabName ) {
1971+ const url = "./TestCaseScript.jsp?" + ReplaceURLParameters ( "tabactive" , tabName ) ;
1972+ InsertURLInHistory ( url ) ;
1973+ }
1974+ }
19621975}
0 commit comments