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