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

Feat/6724 mobile handling #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions css/annotator.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
.annotator-adder {
background-image: url(../img/annotator-icon-sprite.png?embed);
background-repeat: no-repeat;
rotate: 180deg;
}

.annotator-resize,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/adder.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var Adder = Widget.extend({
show: function (position) {
if (typeof position !== 'undefined' && position !== null) {
this.element.css({
top: position.top,
top: position.top + 48,
left: position.left
});
}
Expand Down
12 changes: 3 additions & 9 deletions src/ui/textselector.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ function TextSelector(element, options) {
var self = this;
this.document = this.element.ownerDocument;

$(this.document.body)
.on("mouseup." + TEXTSELECTOR_NS, function (e) {
self._checkForEndSelection(e);
});
document.addEventListener("pointerup", (e) => {
self._checkForEndSelection(e);
});
} else {
console.warn("You created an instance of the TextSelector on an " +
"element that doesn't have an ownerDocument. This won't " +
Expand Down Expand Up @@ -79,11 +78,6 @@ TextSelector.prototype.captureDocumentSelection = function () {
}
}

// BrowserRange#normalize() modifies the DOM structure and deselects the
// underlying text as a result. So here we remove the selected ranges and
// reapply the new ones.
selection.removeAllRanges();

for (i = 0, len = rangesToIgnore.length; i < len; i++) {
selection.addRange(rangesToIgnore[i]);
}
Expand Down