Merge "SideBySide2: Let CodeMirror handle "contextmenu" event" into stable-2.8
This commit is contained in:
@@ -69,7 +69,6 @@ import com.google.gwtexpui.globalkey.client.KeyCommandSet;
|
||||
import com.google.gwtexpui.globalkey.client.ShowHelpCommand;
|
||||
|
||||
import net.codemirror.lib.CodeMirror;
|
||||
import net.codemirror.lib.CodeMirror.EventHandler;
|
||||
import net.codemirror.lib.CodeMirror.GutterClickHandler;
|
||||
import net.codemirror.lib.CodeMirror.LineClassWhere;
|
||||
import net.codemirror.lib.CodeMirror.LineHandle;
|
||||
@@ -111,7 +110,6 @@ public class SideBySide2 extends Screen {
|
||||
|
||||
private CodeMirror cmA;
|
||||
private CodeMirror cmB;
|
||||
private CodeMirror lastFocused;
|
||||
private ScrollSynchronizer scrollingGlue;
|
||||
private HandlerRegistration resizeHandler;
|
||||
private JsArray<CommentInfo> publishedBase;
|
||||
@@ -279,17 +277,9 @@ public class SideBySide2 extends Screen {
|
||||
cm.on("focus", new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
lastFocused = cm;
|
||||
updateActiveLine(cm).run();
|
||||
}
|
||||
});
|
||||
cm.on("contextmenu", new EventHandler() {
|
||||
@Override
|
||||
public void handle(CodeMirror instance, NativeEvent event) {
|
||||
CodeMirror.setObjectProperty(event, "codemirrorIgnore", true);
|
||||
lastFocused.focus();
|
||||
}
|
||||
});
|
||||
cm.addKeyMap(KeyMap.create()
|
||||
.on("'a'", upToChange(true))
|
||||
.on("'u'", upToChange(false))
|
||||
|
Reference in New Issue
Block a user