Merge pull request #1198 from theFigurin/fix-selection-getting-demo
Fix Selection getting demo
This commit is contained in:
commit
ea9d389bd0
1 changed files with 2 additions and 2 deletions
|
@ -357,7 +357,7 @@ As text: <span id="astext"></span>
|
|||
cloned.innerHTML = astext.innerHTML = "";
|
||||
|
||||
// Clone DOM nodes from ranges (we support multiselect here)
|
||||
for (let i = 0; i < selection; i++) {
|
||||
for (let i = 0; i < selection.rangeCount; i++) {
|
||||
cloned.append(selection.getRangeAt(i).cloneContents());
|
||||
}
|
||||
|
||||
|
@ -628,7 +628,7 @@ The most used recipes are probably:
|
|||
|
||||
// then apply Range methods to selection.getRangeAt(0)
|
||||
// or, like here, to all ranges to support multi-select
|
||||
for (let i = 0; i < selection; i++) {
|
||||
for (let i = 0; i < selection.rangeCount; i++) {
|
||||
cloned.append(selection.getRangeAt(i).cloneContents());
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue