You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
547 B
19 lines
547 B
# 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](https://github.com/shvaikalesh).
|
|
|
|
# [Example](https://github.com/sudodoki/toggle-selection/blob/master/example)
|
|
|
|

|