Skip to content

Commit 2ad9491

Browse files
committed
beta prep
1 parent e1217ea commit 2ad9491

File tree

8 files changed

+1137
-1096
lines changed

8 files changed

+1137
-1096
lines changed

dist/x-tag-polyfilled.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
docElement.oMatchesSelector))
3737

3838
var regexParseExt = /([\w\-]+)|(::|:)(\w+)(?:\((.+?(?=\)))\))?/g;
39-
var regexParseEvent = /([\w\-]+)|(::|:)(\w+)(?:\((.+?(?=\)))\))?/g;
4039
var regexCommaArgs = /,\s*/;
4140
var regexCamel = /[A-Z]/g;
4241
var dashLower = c => "-" + c.toLowerCase();
@@ -210,10 +209,11 @@
210209
for (let z in events) refs[z] = xtag.addEvent(node, z, events[z]);
211210
return refs;
212211
},
213-
addEvent (node, key, fn, capture){
214-
var type;
212+
addEvent (node, key, fn, options){
213+
var type;
215214
var stack = fn;
216-
var ref = { data: {}, capture: capture };
215+
var ref = options || {};
216+
ref.data = {};
217217
key.replace(regexParseExt, (match, name, dots, pseudo, args) => {
218218
if (name) type = name;
219219
else if (dots == ':'){
@@ -223,20 +223,20 @@
223223
if (pseudo.onParse) pseudo.onParse(node, type, _args, stack, ref);
224224
}
225225
});
226-
node.addEventListener(type, stack, capture);
226+
node.addEventListener(type, stack, ref);
227227
ref.type = type;
228228
ref.listener = stack;
229229
var event = xtag.events[type];
230230
if (event) {
231231
var listener = function(e){
232232
new Promise((resolve, reject) => {
233-
event.onFilter(this, e, ref, resolve, reject);
233+
event.onFilter ? event.onFilter(this, e, ref, resolve, reject) : resolve();
234234
}).then(() => {
235-
xtag.fireEvent(e.target, type);
235+
xtag.fireEvent(e.target || this, type);
236236
});
237237
}
238238
ref.attached = event.attach.map(key => {
239-
return xtag.addEvent(node, key, listener, true);
239+
return xtag.addEvent(node, key, listener, {capture: true});
240240
});
241241
if (event.onAdd) event.onAdd(node, ref);
242242
}

dist/x-tag-polyfilled.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/x-tag-raw.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
docElement.oMatchesSelector))
77

88
var regexParseExt = /([\w\-]+)|(::|:)(\w+)(?:\((.+?(?=\)))\))?/g;
9-
var regexParseEvent = /([\w\-]+)|(::|:)(\w+)(?:\((.+?(?=\)))\))?/g;
109
var regexCommaArgs = /,\s*/;
1110
var regexCamel = /[A-Z]/g;
1211
var dashLower = c => "-" + c.toLowerCase();
@@ -180,10 +179,11 @@
180179
for (let z in events) refs[z] = xtag.addEvent(node, z, events[z]);
181180
return refs;
182181
},
183-
addEvent (node, key, fn, capture){
184-
var type;
182+
addEvent (node, key, fn, options){
183+
var type;
185184
var stack = fn;
186-
var ref = { data: {}, capture: capture };
185+
var ref = options || {};
186+
ref.data = {};
187187
key.replace(regexParseExt, (match, name, dots, pseudo, args) => {
188188
if (name) type = name;
189189
else if (dots == ':'){
@@ -193,20 +193,20 @@
193193
if (pseudo.onParse) pseudo.onParse(node, type, _args, stack, ref);
194194
}
195195
});
196-
node.addEventListener(type, stack, capture);
196+
node.addEventListener(type, stack, ref);
197197
ref.type = type;
198198
ref.listener = stack;
199199
var event = xtag.events[type];
200200
if (event) {
201201
var listener = function(e){
202202
new Promise((resolve, reject) => {
203-
event.onFilter(this, e, ref, resolve, reject);
203+
event.onFilter ? event.onFilter(this, e, ref, resolve, reject) : resolve();
204204
}).then(() => {
205-
xtag.fireEvent(e.target, type);
205+
xtag.fireEvent(e.target || this, type);
206206
});
207207
}
208208
ref.attached = event.attach.map(key => {
209-
return xtag.addEvent(node, key, listener, true);
209+
return xtag.addEvent(node, key, listener, {capture: true});
210210
});
211211
if (event.onAdd) event.onAdd(node, ref);
212212
}

dist/x-tag-raw.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)