Browse Source

调整注释位置

HuangKai 3 months ago
parent
commit
7903557ed7
2 changed files with 13 additions and 14 deletions
  1. 2 9
      src/index.js
  2. 11 5
      src/view/App.js

+ 2 - 9
src/index.js

@@ -14,21 +14,14 @@ import LocationCard from './view/common/LocationCard';
 import App from './view/App'
 import App from './view/App'
 
 
 
 
-/*
- * Global variables definition
- */
-
-
-let app;
-// Dynamically load config file
-
 let datas = [
 let datas = [
 	new LocationCard(39.96327, 116.36849, 1010, (new Date(Date.now())).toUTCString(), "c1", "1010"),
 	new LocationCard(39.96327, 116.36849, 1010, (new Date(Date.now())).toUTCString(), "c1", "1010"),
 	new LocationCard(39.96337, 116.36859, 1010, (new Date(Date.now())).toUTCString(), "c2", "1010")
 	new LocationCard(39.96337, 116.36859, 1010, (new Date(Date.now())).toUTCString(), "c2", "1010")
 ];
 ];
 
 
 // Create app
 // Create app
-app = new App("swa3s5ex");
+
+let app = new App("swa3s5ex");
 
 
 setInterval(() => {
 setInterval(() => {
 	datas.forEach(item => {
 	datas.forEach(item => {

+ 11 - 5
src/view/App.js

@@ -9,21 +9,27 @@ import PresetsManager from '../ctrl/PresetsManager';
 import PubSub from 'pubsub-js';
 import PubSub from 'pubsub-js';
 import VectorDataManager from '../ctrl/VectorDataManager';
 import VectorDataManager from '../ctrl/VectorDataManager';
 import request from 'request-promise-native';
 import request from 'request-promise-native';
-/**
- * App is the application starter.
- * It creates mostly everything.
+
+
+/*
+ * Global variables definition
  */
  */
 window.EDITOR_URL = window.location.origin + window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')) + "/";
 window.EDITOR_URL = window.location.origin + window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/')) + "/";
 window.UNUSABLE_ICONS = new Set();
 window.UNUSABLE_ICONS = new Set();
 
 
 
 
 
 
+/**
+ * App is the application starter.
+ * It creates mostly everything.
+ */
 export default class App {
 export default class App {
 	constructor(uuid) {
 	constructor(uuid) {
         this.uuid = uuid;
         this.uuid = uuid;
 		this._initI18n();
 		this._initI18n();
-		this._initCtrl();
-        
+		this._initCtrl();        
+
+        // Dynamically load config file
         request(window.EDITOR_URL + "/config.json")
         request(window.EDITOR_URL + "/config.json")
         .then(configTxt => {
         .then(configTxt => {
             window.CONFIG = JSON.parse(configTxt);
             window.CONFIG = JSON.parse(configTxt);