vue-tippy
Advanced tools
Comparing version 0.2.8 to 0.2.9
{ | ||
"name": "vue-tippy", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"description": "", | ||
@@ -32,8 +32,8 @@ "main": "vue-tippy.js", | ||
"uglify-js": "^2.8.29", | ||
"vue": "^2.3.4", | ||
"webpack": "^2.6.1" | ||
"vue": "^2.4.4", | ||
"webpack": "^2.7.0" | ||
}, | ||
"dependencies": { | ||
"tippy.js": "^1.1.3" | ||
"tippy.js": "^1.3.0" | ||
} | ||
} |
@@ -62,6 +62,6 @@ # vue-tippy | ||
#### Bugs | ||
- Constant updating HTML or VueComponent will cause small delay for tooltip to pickup the new content, | ||
if your tooltip depend on it, you can use ```this.$tippy.forceUpdateHtml()``` to update it instantly. | ||
- ~~Constant updating HTML or VueComponent will cause small delay for tooltip to pickup the new content, | ||
if your tooltip depend on it, you can use ```this.$tippy.forceUpdateHtml()``` to update it instantly.~~ fixed in v0.2.9 | ||
## License | ||
[MIT](http://opensource.org/licenses/MIT) |
const Tippy = require('tippy.js'); | ||
const css = require('tippy.js/dist/tippy.css'); | ||
if (!Array.prototype.some) { | ||
Array.prototype.some = function (fun/*, thisArg*/) { | ||
'use strict'; | ||
if (this == null) { | ||
throw new TypeError('Array.prototype.some called on null or undefined'); | ||
} | ||
if (typeof fun !== 'function') { | ||
throw new TypeError(); | ||
} | ||
var t = Object(this); | ||
var len = t.length >>> 0; | ||
var thisArg = arguments.length >= 2 ? arguments[1] : void 0; | ||
for (var i = 0; i < len; i++) { | ||
if (i in t && fun.call(thisArg, t[i], i, t)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
} | ||
var VueTippy = { | ||
install: function (Vue) { | ||
Vue.$tippyInstances = []; | ||
Vue.$tippyComponents = []; | ||
Vue.prototype.$tippy = { | ||
@@ -97,10 +123,28 @@ | ||
el.tippy = new Tippy(el, opts); | ||
el.tippy = new Tippy(el, opts); | ||
if (el.getAttribute('data-html')) { | ||
vnode.context.$children.forEach(function ($vm) { | ||
if (!Vue.$tippyComponents.some(function (x) { | ||
return x._uid === $vm._uid | ||
})) { | ||
if ($vm.$options.updated === undefined) { | ||
$vm.$options.updated = []; | ||
} | ||
$vm.$options.updated.push(function () { | ||
$vm.$tippy.forceUpdateHtml(); | ||
}); | ||
Vue.$tippyComponents.push($vm); | ||
} | ||
}) | ||
} | ||
Vue.$tippyInstances.push({ | ||
el: el, | ||
tippy: el.tippy, | ||
tippy: el.tippy | ||
}); | ||
}) | ||
}, | ||
@@ -110,3 +154,3 @@ unbind: function (el, binding, vnode) { | ||
}, | ||
componentUpdated: function (el, binding,vnode) { | ||
componentUpdated: function (el, binding, vnode) { | ||
@@ -118,3 +162,3 @@ var opts = binding.value || {}; | ||
const handlers = (vnode.data && vnode.data.on) || (vnode.componentOptions && vnode.componentOptions.listeners); | ||
const handlers = (vnode.data && vnode.data.on) || (vnode.componentOptions && vnode.componentOptions.listeners); | ||
@@ -154,12 +198,15 @@ vnode.context.$tippy.destroyTippy(el); | ||
el.tippy.store.forEach(function (s) { | ||
vnode.context.$nextTick(function () { | ||
el.tippy.store.forEach(function (s) { | ||
var popper = s.popper; | ||
var popper = s.popper; | ||
var tip = s.tippyInstance; | ||
var tip = s.tippyInstance; | ||
tip.update(popper); | ||
tip.update(popper); | ||
}); | ||
}); | ||
} | ||
@@ -166,0 +213,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
250851
4148
Updatedtippy.js@^1.3.0