-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of gitlab.com:minds/front into feat/a13-upgrade…
…-ben
- Loading branch information
Showing
31 changed files
with
425 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* moves cursor to the end of a [contentEditable] div. | ||
* may not work on <textArea /> or <input /> | ||
* @param { HTMLDivElement } el a div with contentEditable true | ||
* @returns { void } | ||
*/ | ||
function moveCursorToEnd(el) { | ||
var range, selection; | ||
if (document.createRange) { | ||
//Firefox, Chrome, Opera, Safari, IE 9+ | ||
range = document.createRange(); //Create a range (a range is a like the selection but invisible) | ||
range.selectNodeContents(el); //Select the entire contents of the element with the range | ||
range.collapse(false); //collapse the range to the end point. false means collapse to end rather than the start | ||
selection = window.getSelection(); //get the selection object (allows you to change selection) | ||
selection.removeAllRanges(); //remove any selections already made | ||
selection.addRange(range); //make the range you have just created the visible selection | ||
// @ts-ignore | ||
} else if (document.selection) { | ||
//IE 8 and lower | ||
// @ts-ignore | ||
range = document.body.createTextRange(); //Create a range (a range is a like the selection but invisible) | ||
range.moveToElementText(el); //Select the entire contents of the element with the range | ||
range.collapse(false); //collapse the range to the end point. false means collapse to end rather than the start | ||
range.select(); //Select the range (make it the visible selection | ||
} | ||
} | ||
|
||
export default moveCursorToEnd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:host { | ||
scroll-margin: 10vh; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.