2018-03-09 20:18:59 +00:00
|
|
|
import $ from 'jquery';
|
|
|
|
|
2017-09-01 09:46:08 +00:00
|
|
|
/**
|
|
|
|
* 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]
|
|
|
|
* }
|
2017-09-01 13:25:15 +00:00
|
|
|
* <a v-popover="{options}">popover</a>
|
2017-09-01 09:46:08 +00:00
|
|
|
*/
|
|
|
|
export default {
|
|
|
|
bind(el, binding) {
|
2017-09-01 13:25:15 +00:00
|
|
|
$(el).popover(binding.value);
|
2017-09-01 09:46:08 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
unbind(el) {
|
2018-04-24 20:43:55 +00:00
|
|
|
$(el).popover('dispose');
|
2017-09-01 09:46:08 +00:00
|
|
|
},
|
|
|
|
};
|