File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
/* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.*/
2
2
$ ( document ) . ready ( function ( ) {
3
3
window . initI18N ( function ( ) {
4
- var pageConfig = getActiveExampleConfig ( ) ;
5
- initPage ( pageConfig ) ;
4
+ initPage ( ) ;
6
5
bindEvents ( ) ;
7
6
sidebarScrollFix ( ) ;
8
7
} ) ;
@@ -11,10 +10,9 @@ $(document).ready(function () {
11
10
var aceEditor ;
12
11
var containExamples = true ;
13
12
14
- function initPage ( pageConfig ) {
15
- var showCode = pageConfig . showCode ;
13
+ function initPage ( ) {
16
14
initSideBar ( ) ;
17
- initEditor ( showCode ) ;
15
+ initEditor ( ) ;
18
16
screenResize ( ) ;
19
17
}
20
18
@@ -60,10 +58,11 @@ function screenResize() {
60
58
61
59
//初始化编辑器
62
60
function initCodeEditor ( showCode ) {
61
+ const codeBtn = document . getElementById ( "showCodeBtn" ) ;
63
62
if ( showCode === false ) {
63
+ codeBtn . classList . add ( 'hide' ) ;
64
64
return
65
65
}
66
- const codeBtn = document . getElementById ( "showCodeBtn" ) ;
67
66
codeBtn . classList . remove ( 'hide' ) ;
68
67
if ( ! aceEditor ) {
69
68
aceEditor = ace . edit ( "editor" ) ;
@@ -79,9 +78,10 @@ function initCodeEditor(showCode) {
79
78
}
80
79
81
80
//初始化编辑器以及预览内容
82
- function initEditor ( showCode ) {
81
+ function initEditor ( ) {
82
+ var pageConfig = getActiveExampleConfig ( ) ;
83
83
loadExampleHtml ( ) ;
84
- initCodeEditor ( showCode ) ;
84
+ initCodeEditor ( pageConfig . showCode ) ;
85
85
}
86
86
87
87
function loadExampleHtml ( ) {
You can’t perform that action at this time.
0 commit comments