Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

Commit

Permalink
Reset selection to collapse on anchor when performing shift+click
Browse files Browse the repository at this point in the history
Firefox seems to get rather confused about the window selection when
shift+extending it. Help this poor browser by resetting the window
selection back to the anchor node if the user is holding shift.

Fixes issue #123.
  • Loading branch information
peitschie committed Nov 29, 2013
1 parent 93ba89b commit b77b997
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion webodf/lib/gui/SessionController.js
Original file line number Diff line number Diff line change
Expand Up @@ -919,12 +919,19 @@ gui.SessionController = (function () {
* @param e
*/
function handleMouseDown(e) {
var target = getTarget(e);
var target = getTarget(e),
cursor = odtDocument.getCursor(inputMemberId);
clickStartedWithinContainer = target && domUtils.containsNode(odtDocument.getOdfCanvas().getElement(), target);
if (clickStartedWithinContainer) {
isMouseMoved = false;
mouseDownRootFilter = odtDocument.createRootFilter(target);
clickCount = e.detail;
if (cursor && e.shiftKey) {
// Firefox seems to get rather confused about the window selection when shift+extending it.
// Help this poor browser by resetting the window selection back to the anchor node if the user
// is holding shift.
window.getSelection().collapse(cursor.getAnchorNode(), 0);
}
if (clickCount > 1) {
updateShadowCursor();
}
Expand Down

0 comments on commit b77b997

Please sign in to comment.