Skip to content

Commit

Permalink
Release 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
simplesmiler committed Apr 9, 2018
1 parent bfc4517 commit cdf96b1
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [2.2.2] - 2018-04-09

### Changed
- Fix context with which the away handler is called

## [2.2.1] - 2018-04-08

### Changed
Expand Down Expand Up @@ -97,3 +102,4 @@ Initial release
[2.1.0]: https://github.com/simplesmiler/vue-clickaway/compare/2.0.0...2.1.0
[2.2.0]: https://github.com/simplesmiler/vue-clickaway/compare/2.2.0...2.1.0
[2.2.1]: https://github.com/simplesmiler/vue-clickaway/compare/2.2.0...2.2.1
[2.2.2]: https://github.com/simplesmiler/vue-clickaway/compare/2.2.1...2.2.2
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ $ npm install vue-clickaway --save
From CDN, chose the one you prefer:

``` html
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/vue-clickaway.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-clickaway/2.2.1/vue-clickaway.min.js"></script>
<script src="https://cdn.rawgit.com/simplesmiler/vue-clickaway/2.2.1/dist/vue-clickaway.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/vue-clickaway.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-clickaway/2.2.2/vue-clickaway.min.js"></script>
<script src="https://cdn.rawgit.com/simplesmiler/vue-clickaway/2.2.2/dist/vue-clickaway.min.js"></script>
```

## Usage
Expand Down
8 changes: 5 additions & 3 deletions dist/vue-clickaway.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var Vue = require('vue');
Vue = 'default' in Vue ? Vue['default'] : Vue;

var version = '2.2.1';
var version = '2.2.2';

var compatible = (/^2\./).test(Vue.version);
if (!compatible) {
Expand All @@ -16,9 +16,11 @@ if (!compatible) {

var HANDLER = '_vue_clickaway_handler';

function bind(el, binding) {
function bind(el, binding, vnode) {
unbind(el);

var vm = vnode.context;

var callback = binding.value;
if (typeof callback !== 'function') {
if (process.env.NODE_ENV !== 'production') {
Expand Down Expand Up @@ -51,7 +53,7 @@ function bind(el, binding) {
// @NOTE: `.path` is non-standard, the standard way is `.composedPath()`
var path = ev.path || (ev.composedPath ? ev.composedPath() : undefined);
if (initialMacrotaskEnded && (path ? path.indexOf(el) < 0 : !el.contains(ev.target))) {
return callback(ev);
return callback.call(vm, ev);
}
};

Expand Down
8 changes: 5 additions & 3 deletions dist/vue-clickaway.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

var version = '2.2.1';
var version = '2.2.2';

var compatible = (/^2\./).test(Vue.version);
if (!compatible) {
Expand All @@ -15,9 +15,11 @@

var HANDLER = '_vue_clickaway_handler';

function bind(el, binding) {
function bind(el, binding, vnode) {
unbind(el);

var vm = vnode.context;

var callback = binding.value;
if (typeof callback !== 'function') {
if ('development' !== 'production') {
Expand Down Expand Up @@ -50,7 +52,7 @@
// @NOTE: `.path` is non-standard, the standard way is `.composedPath()`
var path = ev.path || (ev.composedPath ? ev.composedPath() : undefined);
if (initialMacrotaskEnded && (path ? path.indexOf(el) < 0 : !el.contains(ev.target))) {
return callback(ev);
return callback.call(vm, ev);
}
};

Expand Down
2 changes: 1 addition & 1 deletion dist/vue-clickaway.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue';

export var version = '2.2.1';
export var version = '2.2.2';

var compatible = (/^2\./).test(Vue.version);
if (!compatible) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-clickaway",
"description": "Reusable clickaway directive for reusable Vue.js components",
"version": "2.2.1",
"version": "2.2.2",
"author": "Denis Karabaza <[email protected]>",
"browserify": {
"transform": [
Expand Down

0 comments on commit cdf96b1

Please sign in to comment.