main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
547 bytes
|
Line | |
---|
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 | ![example recording](http://g.recordit.co/YPu6mHvcKe.gif)
|
---|
Note:
See
TracBrowser
for help on using the repository browser.