A library to add popup menus at text selections.
Demo page
npm install selection-popup
const selectionPop = require('selection-popup)
selectionPop(['share', '<i class="fa fa-twitter" aria-hidden="true"></i>
', 'log'], [shareFunc, tweetFunc, function(e){
console.log('selected item: ' + e)
} ],{style: 'background-color:yellow'});
add a popup menu to document
Type: array
, String
(for single item)
Type: array
, String
(for single item)
functions for onClick actions of the appropriate items
Type: object
[style]: String
an override styles for customization
Copyright © 2017, Erdem Bircan. Released under the MIT License.