efront 4.22.6 → 4.22.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,7 +29,6 @@ function main() {
29
29
  scope.nodeVersion = a.nodeVersion;
30
30
  scope.platform = a.platform;
31
31
  scope.arch = a.arch;
32
- console.log('status')
33
32
  });
34
33
  return page;
35
34
  }
@@ -119,6 +119,7 @@
119
119
  }
120
120
  return [];
121
121
  };
122
+ var first_opened = false;
122
123
  result.update = function (items) {
123
124
  delete result.loading_promise;
124
125
  delete result.then;
@@ -157,6 +158,7 @@
157
158
  };
158
159
  }
159
160
  }
161
+ first_opened = false;
160
162
  return result;
161
163
  };
162
164
  var setActive = function (p, active) {
@@ -190,14 +192,15 @@
190
192
  });
191
193
  result.open = function (menu) {
192
194
  if (!menu) {
193
- if (result.active) return;
194
- menu = result[0];
195
+ if (first_opened && result.active) return;
196
+ menu = result.active || result[0];
195
197
  }
196
198
  if (!menu.path) {
197
199
  menu.closed = !menu.closed;
198
200
  return;
199
201
  }
200
- if (menu === result.active) return;
202
+ if (first_opened && menu === result.active) return;
203
+ first_opened = true;
201
204
  var opened = result.opened || [];
202
205
  if (!~opened.indexOf(menu) && !getChild(menu).id) {
203
206
  opened.push(menu);
@@ -82,7 +82,7 @@ function main(mainPath, historyName = "") {
82
82
  appendChild.replace(topLayer, page);
83
83
  topLayer = page;
84
84
  }
85
- zimoli();
85
+ if (mainPath) zimoli();
86
86
  };
87
87
  if (typeof leftPath === 'string') {
88
88
  zimoli.prepare(leftPath, hook);
@@ -424,7 +424,6 @@ function zimoli(pagepath, args, history_name, oldpagepath) {
424
424
  if (pagepath === popupHashlessPath) {
425
425
  preventNextHashChange = true;
426
426
  window_history.go(-1);
427
- preventNextHashChange = true;
428
427
  pagepath = pathFromHash(location.hash);
429
428
  }
430
429
  if (_history.index === 0) pagepath = '';
@@ -513,26 +512,36 @@ var getCurrentHash = function () {
513
512
  };
514
513
 
515
514
  var fixurl = function (historyDelta) {
516
- preventNextHashChange = false;
517
515
  var hash = getCurrentHash();
516
+ preventNextHashChange = true;
518
517
  if (pagehash_reg.test(hash)) {
519
518
  hash = location.href.replace(/\#[\s\S]*$/, '') + hash;
520
519
  if (!pagehash_reg.test(location.href)) location.href = hash;
521
520
  else if (location.href !== hash) {
522
521
  if (historyDelta) {
523
- preventNextHashChange = true;
524
522
  window_history.go(historyDelta);
525
- preventNextHashChange = false;
526
523
  if (location.href !== hash) {
527
524
  location.href = hash;
528
525
  }
526
+ else {
527
+ preventNextHashChange = false;
528
+ }
529
+ }
530
+ else if (location.href !== hash) {
531
+ location.href = hash;
532
+ }
533
+ else {
534
+ preventNextHashChange = false;
529
535
  }
530
- else if (location.href !== hash) location.href = hash;
536
+ }
537
+ else {
538
+ preventNextHashChange = false;
531
539
  }
532
540
  }
533
541
  else if (pagehash_reg.test(location.hash)) {
534
- preventNextHashChange = true;
535
542
  window_history.go(-1);
543
+ }
544
+ else {
536
545
  preventNextHashChange = false;
537
546
  }
538
547
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.22.6",
3
+ "version": "4.22.7",
4
4
  "description": "一个开发环境,提供一种自由的前端开发模式,也可作为辅助工具使用。",
5
5
  "main": "public/efront.js",
6
6
  "directories": {