How to use the bootstrap.native.Popover function in bootstrap

To help you get started, we’ve selected a few bootstrap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eslint / website / src / js / demo / components / Configuration.jsx View on Github external
function initPopovers() {
    const popoverElements = document.querySelectorAll("[data-toggle=\"popover\"]");

    for (let i = 0; i < popoverElements.length; ++i) {
        if (!popoverElements[i].Popover) {
            // eslint-disable-next-line no-new
            new Popover(popoverElements[i]);
        }
    }
}
github crcastle / collaborative-code-conference / src / client / coding.js View on Github external
ws.onclose = function() {
    document.querySelector('#editor-connection-status').style.visibility = 'visible';
    link.removeAllListeners('data');
  };
};

// Load gist in editor
//
// on click of 'Load GitHub Gist' button, show modal asking for gist url or id
var Gister = require('./gister');
var g = new Gister();
var loadGistButton   = document.querySelector('#load-gist');
var createGistButton = document.querySelector('#create-gist');
loadGistButton.addEventListener('click', g.loadGistModal.bind(g));
createGistButton.addEventListener('click', g.createGistModal.bind(g));
new bsn.Popover(createGistButton, {trigger: 'click'});  //handle 'create' not implemented yet

// Listen for gist instance to emit file events that we then put in the editor
g.on('file', function(file) {
  cm.setValue(file);
});

// Buttons to scale editor font size up and down
var scaleFactor = 1.2;
var fontBigger = document.querySelector('.size-control.bigger');
fontBigger.addEventListener('click', function() {
  scaleFontSize(cm.getWrapperElement(), scaleFactor);
  cm.refresh();
  cm.focus();
});

var fontSmaller = document.querySelector('.size-control.smaller');
github conversejs / converse.js / src / converse-controlbox.js View on Github external
Array.from(this.el.querySelectorAll('[data-title]')).forEach(el => {
                    new bootstrap.Popover(el, {
                        'trigger': _converse.view_mode === 'mobile' && 'click' || 'hover',
                        'dismissible': _converse.view_mode === 'mobile' && true || false,
                        'container': this.el.parentElement.parentElement.parentElement
                    })
                });
            },