Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
d602da20
Unverified
Commit
d602da20
authored
Nov 15, 2019
by
Dominik Prokop
Committed by
GitHub
Nov 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flot overriding onselectstart/ondrag events (#20381)
parent
e60f7d00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
public/vendor/flot/jquery.flot.selection.js
+16
-2
No files found.
public/vendor/flot/jquery.flot.selection.js
View file @
d602da20
...
...
@@ -323,7 +323,6 @@ The plugin allso adds the following methods to the plot object:
}
});
plot
.
hooks
.
drawOverlay
.
push
(
function
(
plot
,
ctx
)
{
// draw selection
if
(
selection
.
show
&&
selectionIsSane
())
{
...
...
@@ -356,8 +355,23 @@ The plugin allso adds the following methods to the plot object:
eventHolder
.
unbind
(
"mousemove"
,
onMouseMove
);
eventHolder
.
unbind
(
"mousedown"
,
onMouseDown
);
if
(
mouseUpHandler
)
if
(
mouseUpHandler
)
{
$
(
document
).
unbind
(
"mouseup"
,
mouseUpHandler
);
// grafana addition
// In L114 this plugin is overrinding document.onselectstart handler to prevent default or custom behaviour
// Then this patch is being restored during mouseup event. But, mouseup handler is unbound when this plugin is destroyed
// and the overriden onselectstart handler is not restored. The problematic behaviour surfaces when flot is re-rendered
// as a consequence of panel's model update. When i.e. options are applied via onBlur
// event on some input which results in flot re-render. The mouseup handler should be called to resture the original handlers
// but by the time the document mouseup event occurs, the event handler is no longer there, so onselectstart is permanently overriden.
// To fix that we are making sure that the overrides are reverted when this plugin is destroyed, the same way as they would
// via mouseup event handler (L138)
if
(
document
.
onselectstart
!==
undefined
)
document
.
onselectstart
=
savedhandlers
.
onselectstart
;
if
(
document
.
ondrag
!==
undefined
)
document
.
ondrag
=
savedhandlers
.
ondrag
;
}
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment