forked from phoenix/litellm-mirror
18 lines
547 B
Markdown
18 lines
547 B
Markdown
# 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)
|
|
|
|

|