efront 3.10.4 → 3.11.1
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.
- package/apps/pivot/api.yml +1 -0
- package/apps/pivot/home/welcome.html +6 -1
- package/apps/pivot/home/welcome.js +2 -0
- package/coms/frame/route.js +0 -1
- package/coms/zimoli/active.js +5 -1
- package/coms/zimoli/bindAccesskey.js +47 -0
- package/coms/zimoli/button.js +0 -34
- package/coms/zimoli/color.js +4 -2
- package/coms/zimoli/data.js +8 -5
- package/coms/zimoli/menu.js +8 -4
- package/coms/zimoli/menu.less +12 -5
- package/coms/zimoli/menuItem.html +2 -2
- package/coms/zimoli/menuItem.js +7 -3
- package/coms/zimoli/menuList.html +2 -2
- package/coms/zimoli/menuList.js +268 -39
- package/coms/zimoli/menuList.less +6 -1
- package/coms/zimoli/on.js +14 -3
- package/coms/zimoli/render.js +39 -13
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/zimoli/on.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var is_addEventListener_enabled = "addEventListener" in window;
|
|
3
3
|
var handlersMap = {};
|
|
4
4
|
var changes_key = 'changes';
|
|
5
|
-
var eventtypereg = /(?:\.once|\.prevent|\.stop|\.capture|\.self|\.passive|\.[a-z0-9]+)
|
|
5
|
+
var eventtypereg = /(?:\.once|\.prevent|\.stop|\.capture|\.self|\.passive|\.[a-z0-9]+)+\.?$/i;
|
|
6
6
|
var keyCodeMap = {
|
|
7
7
|
backspace: 8,
|
|
8
8
|
tab: 9,
|
|
@@ -118,6 +118,9 @@ var parseEventTypes = function (eventtypes) {
|
|
|
118
118
|
case "ctrl":
|
|
119
119
|
keyneed.push(t);
|
|
120
120
|
break;
|
|
121
|
+
case "":
|
|
122
|
+
if (!types.keyCode) types.keyCode = true;
|
|
123
|
+
break;
|
|
121
124
|
default:
|
|
122
125
|
if (isFinite(t)) {
|
|
123
126
|
types.keyCode = +t;
|
|
@@ -133,12 +136,20 @@ var parseEventTypes = function (eventtypes) {
|
|
|
133
136
|
return types;
|
|
134
137
|
}
|
|
135
138
|
function checkKeyNeed(eventtypes, e) {
|
|
139
|
+
var keyneed = eventtypes.keyNeed;
|
|
136
140
|
if (eventtypes.keyNeed) {
|
|
137
|
-
for (var cx = 0, dx =
|
|
138
|
-
var key =
|
|
141
|
+
for (var cx = 0, dx = keyneed.length; cx < dx; cx++) {
|
|
142
|
+
var key = keyneed[cx];
|
|
139
143
|
if (!e[key + "Key"]) return false;
|
|
140
144
|
}
|
|
141
145
|
}
|
|
146
|
+
if (eventtypes.keyCode === true) {
|
|
147
|
+
for (var cx = 0, dx = keyneed.length; cx < dx; cx++) {
|
|
148
|
+
var key = keyneed[cx];
|
|
149
|
+
if (e.keyCode === keyCodeMap[key]) return true;
|
|
150
|
+
}
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
142
153
|
if (eventtypes.keyCode) {
|
|
143
154
|
return e.keyCode === eventtypes.keyCode;
|
|
144
155
|
}
|
package/coms/zimoli/render.js
CHANGED
|
@@ -527,25 +527,51 @@ var binders = {
|
|
|
527
527
|
});
|
|
528
528
|
}
|
|
529
529
|
};
|
|
530
|
-
var
|
|
531
|
-
|
|
530
|
+
var createEmiter = function (on) {
|
|
531
|
+
return function (key, search) {
|
|
532
|
+
if (this.$src) {
|
|
533
|
+
var parsedSrc = this.$src;
|
|
534
|
+
var scopes = this.$parentScopes;
|
|
535
|
+
search = search.slice();
|
|
536
|
+
search[0] += `with(this.$parentScopes[${scopes.length}])`;
|
|
537
|
+
this.$parentScopes = scopes.concat(this.$scope);
|
|
538
|
+
}
|
|
532
539
|
var getter = createGetter(search, false);
|
|
533
540
|
on(key)(this, function (e) {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
541
|
+
if (parsedSrc) {
|
|
542
|
+
var target = e.currentTarget || e.target;
|
|
543
|
+
var scopes = target && target.$parentScopes;
|
|
544
|
+
if (scopes) {
|
|
545
|
+
var scope = null;
|
|
546
|
+
for (var cx = scopes.length - 1; cx >= 0; cx--) {
|
|
547
|
+
var s = scopes[cx];
|
|
548
|
+
if (s === this.$scope) {
|
|
549
|
+
scope = scopes[cx + 1];
|
|
550
|
+
break;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
if (!scope && target.$scope !== this.$scope) scope = target.$scope;
|
|
555
|
+
}
|
|
556
|
+
var res;
|
|
557
|
+
if (scope) {
|
|
558
|
+
var temp = this.$scope;
|
|
559
|
+
this.$scope = scope;
|
|
560
|
+
res = getter.call(this, e);
|
|
561
|
+
this.$scope = temp;
|
|
562
|
+
}
|
|
563
|
+
else {
|
|
564
|
+
res = getter.call(this, e);
|
|
565
|
+
}
|
|
544
566
|
if (res && isFunction(res.then)) res.then(digest, digest);
|
|
545
567
|
digest();
|
|
546
568
|
return res;
|
|
547
569
|
});
|
|
548
|
-
}
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
var emiters = {
|
|
573
|
+
on: createEmiter(on),
|
|
574
|
+
once: createEmiter(once),
|
|
549
575
|
};
|
|
550
576
|
emiters.v = emiters.ng = emiters.on;
|
|
551
577
|
|