xdamman / selection-sharer

Medium like popover menu to share on Twitter or by email any text selected on the page
MIT License
509 stars 104 forks source link

Share one word #3

Open martgnz opened 9 years ago

martgnz commented 9 years ago

The behaviour of Medium makes the popup appear when you select only one word. It's possible to adjust this plugin to do the same?

Thanks

xdamman commented 9 years ago

Yep, shouldn't be hard. PR welcome :-)

dandv commented 9 years ago

Sharing one word works in my fork of SelectionMenu that addresses a few other issues from selection-sharer and makes it general (i.e you can put anything you want in the menu).

Check out the minlength property.

q2apro commented 6 years ago

Why not give a direct link to the source? https://github.com/iDoRecall/selection-menu/blob/gh-pages/src/selection-menu.js#L132 https://github.com/iDoRecall/selection-menu/blob/gh-pages/src/selection-menu.js#L181

For the repo here it should be:

https://github.com/xdamman/selection-sharer/blob/master/src/selection-sharer.js#L145

Removing the selection.length>10 part should do it.