Skip to content

Commit 1262d28

Browse files
committed
Release 2.2.1
1 parent f58713e commit 1262d28

File tree

7 files changed

+23
-12
lines changed

7 files changed

+23
-12
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [2.2.1] - 2018-04-08
2+
3+
### Changed
4+
- Fix regression, fallback to `.contains` if `.path` is not supported
5+
16
## [2.2.0] - 2018-04-08
27

38
### Changed
@@ -90,3 +95,5 @@ Initial release
9095
[2.0.0-rc.1]: https://github.com/simplesmiler/vue-clickaway/compare/1.1.5...2.0.0-rc.1
9196
[2.0.0]: https://github.com/simplesmiler/vue-clickaway/compare/2.0.0-rc.1...2.0.0
9297
[2.1.0]: https://github.com/simplesmiler/vue-clickaway/compare/2.0.0...2.1.0
98+
[2.2.0]: https://github.com/simplesmiler/vue-clickaway/compare/2.2.0...2.1.0
99+
[2.2.1]: https://github.com/simplesmiler/vue-clickaway/compare/2.2.0...2.2.1

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ $ npm install vue-clickaway --save
2929
From CDN, chose the one you prefer:
3030

3131
``` html
32-
<script src="https://cdn.jsdelivr.net/npm/[email protected].0/dist/vue-clickaway.min.js"></script>
33-
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-clickaway/2.1.0/vue-clickaway.min.js"></script>
34-
<script src="https://cdn.rawgit.com/simplesmiler/vue-clickaway/2.2.0/dist/vue-clickaway.min.js"></script>
32+
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/vue-clickaway.min.js"></script>
33+
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-clickaway/2.2.1/vue-clickaway.min.js"></script>
34+
<script src="https://cdn.rawgit.com/simplesmiler/vue-clickaway/2.2.1/dist/vue-clickaway.min.js"></script>
3535
```
3636

3737
## Usage

dist/vue-clickaway.common.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
var Vue = require('vue');
44
Vue = 'default' in Vue ? Vue['default'] : Vue;
55

6-
var version = '2.2.0';
6+
var version = '2.2.1';
77

88
var compatible = (/^2\./).test(Vue.version);
99
if (!compatible) {
@@ -44,11 +44,13 @@ function bind(el, binding) {
4444
}, 0);
4545

4646
el[HANDLER] = function(ev) {
47-
// @NOTE: this test used to be `el.containts`, but `ev.path` is better,
47+
// @NOTE: this test used to be `el.containts`, but working with path is better,
4848
// because it tests whether the element was there at the time of
4949
// the click, not whether it is there now, that the event has arrived
5050
// to the top.
51-
if (initialMacrotaskEnded && ev.path.indexOf(el) < 0) {
51+
// @NOTE: `.path` is non-standard, the standard way is `.composedPath()`
52+
let path = ev.path || (ev.composedPath ? ev.composedPath() : undefined);
53+
if (initialMacrotaskEnded && (path ? path.indexOf(el) < 0 : !el.contains(ev.target))) {
5254
return callback(ev);
5355
}
5456
};

dist/vue-clickaway.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Vue = 'default' in Vue ? Vue['default'] : Vue;
44

5-
var version = '2.2.0';
5+
var version = '2.2.1';
66

77
var compatible = (/^2\./).test(Vue.version);
88
if (!compatible) {
@@ -43,11 +43,13 @@
4343
}, 0);
4444

4545
el[HANDLER] = function(ev) {
46-
// @NOTE: this test used to be `el.containts`, but `ev.path` is better,
46+
// @NOTE: this test used to be `el.containts`, but working with path is better,
4747
// because it tests whether the element was there at the time of
4848
// the click, not whether it is there now, that the event has arrived
4949
// to the top.
50-
if (initialMacrotaskEnded && ev.path.indexOf(el) < 0) {
50+
// @NOTE: `.path` is non-standard, the standard way is `.composedPath()`
51+
let path = ev.path || (ev.composedPath ? ev.composedPath() : undefined);
52+
if (initialMacrotaskEnded && (path ? path.indexOf(el) < 0 : !el.contains(ev.target))) {
5153
return callback(ev);
5254
}
5355
};

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Vue from 'vue';
22

3-
export var version = '2.2.0';
3+
export var version = '2.2.1';
44

55
var compatible = (/^2\./).test(Vue.version);
66
if (!compatible) {

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-clickaway",
33
"description": "Reusable clickaway directive for reusable Vue.js components",
4-
"version": "2.2.0",
4+
"version": "2.2.1",
55
"author": "Denis Karabaza <[email protected]>",
66
"browserify": {
77
"transform": [

0 commit comments

Comments
 (0)