Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
flot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
flot
Commits
7f906431
Commit
7f906431
authored
Apr 16, 2014
by
David Schnur
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1285 from dnschnur/jquery-attr-fix
Fix zoom to selection box when using jQuery 1.9+.
parents
095799cd
4964dcb3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
index.html
examples/selection/index.html
+10
-1
No files found.
examples/selection/index.html
View file @
7f906431
...
@@ -12,6 +12,15 @@
...
@@ -12,6 +12,15 @@
$
(
function
()
{
$
(
function
()
{
// Shim allowing us to get the state of the check-box on jQuery versions
// prior to 1.6, when prop was added. The reason we don't just use attr
// is because it doesn't work in jQuery versions 1.9.x and later.
// TODO: Remove this once Flot's minimum supported jQuery reaches 1.6.
if
(
typeof
$
.
fn
.
prop
!=
'function'
)
{
$
.
fn
.
prop
=
$
.
fn
.
attr
;
}
var
data
=
[{
var
data
=
[{
label
:
"United States"
,
label
:
"United States"
,
data
:
[[
1990
,
18.9
],
[
1991
,
18.7
],
[
1992
,
18.4
],
[
1993
,
19.3
],
[
1994
,
19.5
],
[
1995
,
19.3
],
[
1996
,
19.4
],
[
1997
,
20.2
],
[
1998
,
19.8
],
[
1999
,
19.9
],
[
2000
,
20.4
],
[
2001
,
20.1
],
[
2002
,
20.0
],
[
2003
,
19.8
],
[
2004
,
20.4
]]
data
:
[[
1990
,
18.9
],
[
1991
,
18.7
],
[
1992
,
18.4
],
[
1993
,
19.3
],
[
1994
,
19.5
],
[
1995
,
19.3
],
[
1996
,
19.4
],
[
1997
,
20.2
],
[
1998
,
19.8
],
[
1999
,
19.9
],
[
2000
,
20.4
],
[
2001
,
20.1
],
[
2002
,
20.0
],
[
2003
,
19.8
],
[
2004
,
20.4
]]
...
@@ -64,7 +73,7 @@
...
@@ -64,7 +73,7 @@
$
(
"#selection"
).
text
(
ranges
.
xaxis
.
from
.
toFixed
(
1
)
+
" to "
+
ranges
.
xaxis
.
to
.
toFixed
(
1
));
$
(
"#selection"
).
text
(
ranges
.
xaxis
.
from
.
toFixed
(
1
)
+
" to "
+
ranges
.
xaxis
.
to
.
toFixed
(
1
));
var
zoom
=
$
(
"#zoom"
).
attr
(
"checked"
);
var
zoom
=
$
(
"#zoom"
).
prop
(
"checked"
);
if
(
zoom
)
{
if
(
zoom
)
{
$
.
each
(
plot
.
getXAxes
(),
function
(
_
,
axis
)
{
$
.
each
(
plot
.
getXAxes
(),
function
(
_
,
axis
)
{
...
...
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