11
11
{{template "floatingform" .}}
12
12
</ head >
13
13
14
- < body class ="bg-light ">
14
+ < body class ="tab-content ">
15
15
{{template "navbar" .}}
16
16
17
17
< main role ="main " class ="container ">
@@ -31,7 +31,7 @@ <h1>Realm settings</h1>
31
31
</ li >
32
32
{{end}}
33
33
< li class ="nav-item " role ="presentation ">
34
- < a class ="nav-link " id ="general-tab " data-toggle ="tab " href ="#general " role ="tab " aria-controls ="general " aria-selected ="true "> General</ a >
34
+ < a class ="nav-link active " id ="general-tab " data-toggle ="tab " href ="#general " role ="tab " aria-controls ="general " aria-selected ="true "> General</ a >
35
35
</ li >
36
36
< li class ="nav-item " role ="presentation ">
37
37
< a class ="nav-link " id ="codes-tab " data-toggle ="tab " href ="#codes " role ="tab " aria-controls ="codes " aria-selected ="false "> Codes</ a >
@@ -51,11 +51,11 @@ <h1>Realm settings</h1>
51
51
< div class ="card-body ">
52
52
< div class ="tab-content ">
53
53
{{if not $realm.EnableENExpress}}
54
- < div class ="tab-pane " id ="express " role ="tabpanel " aria-labelledby ="express-tab ">
54
+ < div class ="tab-pane " id ="express-tab " role ="tabpanel " aria-labelledby ="express-tab ">
55
55
{{template "realmadmin/_form_express" .}}
56
56
</ div >
57
57
{{end}}
58
- < div class ="tab-pane " id ="general " role ="tabpanel " aria-labelledby ="general-tab ">
58
+ < div class ="tab-pane active " id ="general " role ="tabpanel " aria-labelledby ="general-tab ">
59
59
{{template "realmadmin/_form_general" .}}
60
60
</ div >
61
61
< div class ="tab-pane " id ="codes " role ="tabpanel " aria-labelledby ="codes-tab ">
@@ -96,17 +96,18 @@ <h1>Realm settings</h1>
96
96
97
97
< script type ="text/javascript ">
98
98
$ ( function ( ) {
99
- let hash = window . location . hash ;
100
- if ( hash ) {
101
- $ ( `ul.nav a[href="${ hash } "]` ) . tab ( 'show' ) ;
102
- }
99
+ changeTab ( window . location . hash ) ;
103
100
104
101
$ ( '.nav-tabs a' ) . on ( 'click' , function ( event ) {
105
- $ ( this ) . tab ( 'show' ) ;
102
+ changeTab ( this . hash ) ;
103
+ } ) ;
104
+
105
+ function changeTab ( hash ) {
106
+ $ ( `ul.nav a[href="${ hash } "]` ) . tab ( 'show' ) ;
106
107
let mem = $ ( 'body' ) . scrollTop ( ) || $ ( 'html' ) . scrollTop ( ) ;
107
- window . location . hash = this . hash ;
108
+ window . location . hash = hash ;
108
109
$ ( 'html,body' ) . scrollTop ( mem ) ;
109
- } ) ;
110
+ }
110
111
111
112
{ { if $realm . EnableENExpress } }
112
113
let $showAdvancedSettings = $ ( '#show-advanced-settings' ) ;
0 commit comments