2018-05-09 12:01:36 +05:30
|
|
|
import $ from 'jquery';
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
/**
|
|
|
|
* Helper to user bootstrap popover in vue.js.
|
|
|
|
* Follow docs for html attributes: https://getbootstrap.com/docs/3.3/javascript/#static-popover
|
|
|
|
*
|
|
|
|
* @example
|
|
|
|
* import popover from 'vue_shared/directives/popover.js';
|
|
|
|
* {
|
|
|
|
* directives: [popover]
|
|
|
|
* }
|
|
|
|
* <a v-popover="{options}">popover</a>
|
|
|
|
*/
|
|
|
|
export default {
|
|
|
|
bind(el, binding) {
|
|
|
|
$(el).popover(binding.value);
|
|
|
|
},
|
|
|
|
|
|
|
|
unbind(el) {
|
2018-11-08 19:23:39 +05:30
|
|
|
$(el).popover('dispose');
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
|
|
|
};
|