main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
547 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | # Toggle Selection
|
---|
| 2 |
|
---|
| 3 | Simple module exposing function that deselects current browser selection and returns function that restores selection.
|
---|
| 4 |
|
---|
| 5 | ```
|
---|
| 6 | var deselect = require('toggle-selection');
|
---|
| 7 | var reselect = deselect(); // remove all selection
|
---|
| 8 | // …
|
---|
| 9 | // do something with current selection, text, etc;
|
---|
| 10 | // …
|
---|
| 11 | reselect(); // restore selection
|
---|
| 12 | ```
|
---|
| 13 |
|
---|
| 14 | All credits go to [@shvaikalesh](https://github.com/shvaikalesh).
|
---|
| 15 |
|
---|
| 16 | # [Example](https://github.com/sudodoki/toggle-selection/blob/master/example)
|
---|
| 17 |
|
---|
| 18 | 
|
---|
Note:
See
TracBrowser
for help on using the repository browser.