Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba68e6f

Browse files
committed
Merge pull request #4032 from blink1073/remove-webagg-context-menu
Disable context menu in webagg
1 parent b8a5f91 commit ba68e6f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/matplotlib/backends/web_backend/mpl.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ mpl.figure.prototype._init_canvas = function() {
196196
// upon first draw.
197197
this._resize_canvas(600, 600);
198198

199+
// Disable right mouse context menu.
200+
$(this.rubberband_canvas).bind("contextmenu",function(e){
201+
return false;
202+
});
199203

200204
function set_focus () {
201205
canvas.focus();

lib/matplotlib/backends/web_backend/nbagg_mpl.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,6 @@ mpl.mpl_figure_comm = function(comm, msg) {
5252
var output_index = fig.cell_info[2]
5353
var cell = fig.cell_info[0];
5454

55-
// Disable right mouse context menu.
56-
$(fig.rubberband_canvas).bind("contextmenu",function(e){
57-
return false;
58-
});
59-
6055
};
6156

6257
mpl.figure.prototype.handle_close = function(fig, msg) {

0 commit comments

Comments
 (0)