chore(add husky): add standard and commitlint

This commit is contained in:
youxingzhi
2018-12-11 11:16:29 +08:00
parent 2b2b1419ad
commit 867ef2a7fa
8 changed files with 31 additions and 17 deletions

View File

@@ -4,28 +4,28 @@
var handlerCache
exports.addHandler = function(element, type, handler) {
exports.addHandler = function (element, type, handler) {
handlerCache = handler
if (element.addEventListener) {
element.addEventListener(type, handler, false);
element.addEventListener(type, handler, false)
} else if (element.attachEvent) {
element.attachEvent("on" + type, handler);
element.attachEvent('on' + type, handler)
} else {
element["on" + type] = handler;
element['on' + type] = handler
}
}
exports.removeHandler = function (element, type) {
if (element.removeEventListener) {
element.removeEventListener(type, handlerCache, false);
element.removeEventListener(type, handlerCache, false)
} else if (element.detachEvent) {
element.detachEvent("on" + type, handlerCache);
element.detachEvent('on' + type, handlerCache)
} else {
element["on" + type] = null;
element['on' + type] = null
}
}
// exports.fireFocusEvent = function (ele) {
// var event = new FocusEvent()
// ele.dispatch(event)
// }
// }