Skip to content

Commit

Permalink
Fix a few more issues introduced by the refactor (closes #831).
Browse files Browse the repository at this point in the history
  • Loading branch information
0b10011 authored and marijnh committed Sep 17, 2012
1 parent 06f0a51 commit 3b44497
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/codemirror.js
Expand Up @@ -1175,7 +1175,7 @@ window.CodeMirror = (function() {

switch (e_button(e)) {
case 3:
if (gecko) onContextMenu.call(cm, e);
if (gecko) onContextMenu.call(cm, cm, e);
return;
case 2:
if (start) setSelectionUser(cm, start, start);
Expand Down Expand Up @@ -1501,15 +1501,15 @@ window.CodeMirror = (function() {
var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;
if (!pos || opera) return; // Opera is difficult.
if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to))
operation(setSelection)(cm, pos, pos);
operation(cm, setSelection)(cm, pos, pos);

var oldCSS = display.input.style.cssText;
display.inputDiv.style.position = "absolute";
display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) +
"px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; outline: none;" +
"border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
focusInput(cm);
resetInput(display, view, true);
resetInput(display, cm.view, true);
// Adds "Select all" to context menu in FF
if (posEq(sel.from, sel.to)) display.input.value = display.prevInput = " ";

Expand All @@ -1529,7 +1529,7 @@ window.CodeMirror = (function() {
if (display.prevInput == " " && display.input.selectionStart == 0)
operation(cm, commands.selectAll)(cm);
else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500);
else resetInput(display, view);
else resetInput(display, cm.view);
}, 200);
}
}
Expand Down

0 comments on commit 3b44497

Please sign in to comment.