Przeglądaj źródła

调整注释位置

HuangKai 3 miesięcy temu
rodzic
commit
7903557ed7
2 zmienionych plików z 13 dodań i 14 usunięć
  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'
 
 
-/*
- * Global variables definition
- */
-
-
-let app;
-// Dynamically load config file
-
 let datas = [
 	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")
 ];
 
 // Create app
-app = new App("swa3s5ex");
+
+let app = new App("swa3s5ex");
 
 setInterval(() => {
 	datas.forEach(item => {

+ 11 - 5
src/view/App.js

@@ -9,21 +9,27 @@ import PresetsManager from '../ctrl/PresetsManager';
 import PubSub from 'pubsub-js';
 import VectorDataManager from '../ctrl/VectorDataManager';
 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.UNUSABLE_ICONS = new Set();
 
 
 
+/**
+ * App is the application starter.
+ * It creates mostly everything.
+ */
 export default class App {
 	constructor(uuid) {
         this.uuid = uuid;
 		this._initI18n();
-		this._initCtrl();
-        
+		this._initCtrl();        
+
+        // Dynamically load config file
         request(window.EDITOR_URL + "/config.json")
         .then(configTxt => {
             window.CONFIG = JSON.parse(configTxt);