mirror of https://github.com/pyodide/pyodide.git
Don't disable right click globally for matplotlib figures (#1555)
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
This commit is contained in:
parent
8932d6d938
commit
7384745fa4
|
@ -120,8 +120,6 @@ class FigureCanvasWasm(backend_agg.FigureCanvasAgg):
|
|||
event.preventDefault()
|
||||
return False
|
||||
|
||||
window.addEventListener("contextmenu", ignore)
|
||||
|
||||
# Create the main canvas and determine the physical to logical pixel
|
||||
# ratio
|
||||
canvas = document.createElement("canvas")
|
||||
|
@ -132,6 +130,7 @@ class FigureCanvasWasm(backend_agg.FigureCanvasAgg):
|
|||
width *= self._ratio
|
||||
height *= self._ratio
|
||||
div = self.create_root_element()
|
||||
div.addEventListener("contextmenu", ignore)
|
||||
div.setAttribute(
|
||||
"style",
|
||||
"margin: 0 auto; text-align: center;"
|
||||
|
|
Loading…
Reference in New Issue