UNPKG

datasafer-laravel

Version:

Extensão do sitema de frontend para o Laravel Mix

30 lines (24 loc) 909 B
import * as $ from 'jquery'; import 'bootstrap'; export default (function () { // ------------------------------------------------------ // @Popover // ------------------------------------------------------ $('[data-toggle="popover"]').popover() .on('inserted.bs.popover', ()=>{ window.fnUpdateCopyClipboard(); }); // ------------------------------------------------------ // @Tooltips // ------------------------------------------------------ $('[data-toggle="tooltip"]').tooltip(); $('body').on('click', function (e) { $('[data-toggle="popover"]').each(function () { //the 'is' for buttons that trigger popups //the 'has' for icons within a button that triggers a popup if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) { $(this).popover('hide'); } }); }); }());