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 11/* Copyright© 2000 - 2023 SuperMap Software Co.Ltd. All rights reserved.*/
22$ ( document ) . ready ( function ( ) {
33 window . initI18N ( function ( ) {
4- var pageConfig = getActiveExampleConfig ( ) ;
5- initPage ( pageConfig ) ;
4+ initPage ( ) ;
65 bindEvents ( ) ;
76 sidebarScrollFix ( ) ;
87} ) ;
@@ -11,10 +10,9 @@ $(document).ready(function () {
1110var aceEditor ;
1211var containExamples = true ;
1312
14- function initPage ( pageConfig ) {
15- var showCode = pageConfig . showCode ;
13+ function initPage ( ) {
1614 initSideBar ( ) ;
17- initEditor ( showCode ) ;
15+ initEditor ( ) ;
1816 screenResize ( ) ;
1917}
2018
@@ -60,10 +58,11 @@ function screenResize() {
6058
6159//初始化编辑器
6260function initCodeEditor ( showCode ) {
61+ const codeBtn = document . getElementById ( "showCodeBtn" ) ;
6362 if ( showCode === false ) {
63+ codeBtn . classList . add ( 'hide' ) ;
6464 return
6565 }
66- const codeBtn = document . getElementById ( "showCodeBtn" ) ;
6766 codeBtn . classList . remove ( 'hide' ) ;
6867 if ( ! aceEditor ) {
6968 aceEditor = ace . edit ( "editor" ) ;
@@ -79,9 +78,10 @@ function initCodeEditor(showCode) {
7978}
8079
8180//初始化编辑器以及预览内容
82- function initEditor ( showCode ) {
81+ function initEditor ( ) {
82+ var pageConfig = getActiveExampleConfig ( ) ;
8383 loadExampleHtml ( ) ;
84- initCodeEditor ( showCode ) ;
84+ initCodeEditor ( pageConfig . showCode ) ;
8585}
8686
8787function loadExampleHtml ( ) {
You can’t perform that action at this time.
0 commit comments