efront 3.11.1 → 3.11.2

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.
@@ -11,6 +11,7 @@ var clear = function () {
11
11
  var unfocus = function () {
12
12
  remove(mounted_menus);
13
13
  this.ispop = false;
14
+ this.setFocus();
14
15
  };
15
16
  var setFocus = function (focused = this.firstMenu) {
16
17
  var page = this;
@@ -128,8 +129,11 @@ function keyright() {
128
129
  }
129
130
  function keyspace() {
130
131
  if (root_menu !== document.activeElement) return;
131
- var menu = mounted_menus[mounted_menus.length - 1] || root_menu;
132
- menu.focused.click();
132
+ var menu = mounted_menus[mounted_menus.length - 1];
133
+ if (!menu || !menu.focused) menu = mounted_menus[mounted_menus.length - 2] || root_menu;
134
+ if (menu.focused) {
135
+ menu.focused.click();
136
+ }
133
137
  }
134
138
  function register() {
135
139
  // on('keydown.alt')(window, e => e.preventDefault());
@@ -150,9 +154,9 @@ function main(page, items, active, direction = 'y') {
150
154
  var main = this;
151
155
  if (direction !== 'x') page.ispop = true;
152
156
  function popMenu(item, target) {
153
- if (page.active) {
157
+ if (page.actived) {
154
158
  clear();
155
- remove(page.active);
159
+ remove(page.actived);
156
160
  }
157
161
  page.setFocus(target);
158
162
  if (!item.children || !item.children.length) return;
@@ -162,7 +166,7 @@ function main(page, items, active, direction = 'y') {
162
166
  clone.innerHTML = template.innerHTML;
163
167
  var menu = main(clone, item.children, active);
164
168
  mounted_menus.push(menu);
165
- page.active = menu;
169
+ page.actived = menu;
166
170
  menu.root = page.root || page;
167
171
  popup(menu, target);
168
172
  if (page.ispop === true) {
@@ -210,7 +214,7 @@ function main(page, items, active, direction = 'y') {
210
214
  if (pop === false) return;
211
215
  var root = page.root || page;
212
216
  if (root.ispop === 1) root.ispop = false;
213
- if (page.active && page.active.target === this) {
217
+ if (page.actived && page.actived.target === this) {
214
218
  if (!mounted_menus.length) {
215
219
  popMenu(this.menu, this);
216
220
  }
@@ -221,6 +225,9 @@ function main(page, items, active, direction = 'y') {
221
225
  else {
222
226
  while (mounted_menus.length && mounted_menus[mounted_menus.length - 1] !== page) remove(mounted_menus.pop());
223
227
  popMenu(this.menu, this);
228
+ if (!page.actived) {
229
+ (page.root || page).blur();
230
+ }
224
231
  }
225
232
  };
226
233
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.11.1",
3
+ "version": "3.11.2",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {