toggle-selection
Toggle current selected content in browser
Last updated 8 years ago by sudodoki .
MIT · Repository · Bugs · Original npm
$ cnpm install toggle-selection 
SYNC missed versions from official npm registry.

Toggle Selection

Simple module exposing function that deselects current browser selection and returns function that restores selection.

var deselect = require('toggle-selection');
var reselect = deselect(); // remove all selection
// … 
// do something with current selection, text, etc;
// …
reselect(); // restore selection

All credits go to @shvaikalesh.

Example

example recording

Current Tags

  • 1.0.6                                ...           latest (8 years ago)

1 Versions

  • 1.0.6                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org