Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor TableView to ES6 #5690

Merged
merged 4 commits into from Jan 2, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+696 −558
Diff settings

Always

Just for now

Next

Refactor tableview to ES6. WIP

  • Loading branch information...
swistach committed Dec 20, 2018
commit 19720979cee5a9b1bb16d46d36020952982e3b6e
Copy path View file
@@ -152,3 +152,19 @@ function _checkKeySchema(v) {
return p === z;
}
/* eslint-enable */

/**
* Cross-platform helper to clear text selection.
*/
export function clearTextSelection() {
This conversation was marked as resolved by swistach

This comment has been minimized.

Copy link
@budnix

budnix Dec 21, 2018

Member

The better place for this function will be the dom/element.js file. There you can find functions similar to this one, such as getSelectionText (https://github.com/handsontable/handsontable/blob/master/src/helpers/dom/element.js#L851)

// http://stackoverflow.com/questions/3169786/clear-text-selection-with-javascript
if (window.getSelection) {
if (window.getSelection().empty) { // Chrome
window.getSelection().empty();
} else if (window.getSelection().removeAllRanges) { // Firefox
window.getSelection().removeAllRanges();
}
} else if (document.selection) { // IE?
document.selection.empty();
}
};
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.