Skip to content

Commit

Permalink
feat: 添加 click event action 事件 (#306)
Browse files Browse the repository at this point in the history
* feat: 添加 click event action 事件

* release: v1.0.83

* fix: 修复iOS8报错
  • Loading branch information
xuexb authored Apr 26, 2018
1 parent 0791d3e commit 8e86a85
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mip",
"version": "1.0.82",
"version": "1.0.83",
"description": "mobile instant page",
"main": "dist/mip.js",
"dependencies": {},
Expand Down
2 changes: 1 addition & 1 deletion src/utils/fn.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ define(function (require) {
* @return {boolean}
*/
function isPlainObject(obj) {
return !!obj && Object.getPrototypeOf(obj) == Object.prototype;
return !!obj && 'object' === typeof obj && Object.getPrototypeOf(obj) == Object.prototype;
}

/**
Expand Down
6 changes: 5 additions & 1 deletion src/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ define(function (require) {
}, false);
}

document.addEventListener('click', function (event) {
eventAction.execute('click', event.target, event);
}, false);

/* istanbul ignore next */
util.event.delegate(document, 'input', 'change', function (e) {
eventAction.execute('change', event.target, event);
Expand Down Expand Up @@ -215,7 +219,7 @@ define(function (require) {
lastDirect = dist/Math.abs(dist);
self.sendMessage('mipscroll', { 'direct': direct, 'dist': dist});
}
}
}
else if (scrollTop === 0) {
self.sendMessage('mipscroll', { 'direct': 0 });
}
Expand Down

0 comments on commit 8e86a85

Please sign in to comment.