Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
d896284a
Commit
d896284a
authored
Mar 10, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复Firefox不响应mousewheel的问题
parent
3d19060c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
minder.event.js
src/core/minder.event.js
+13
-9
No files found.
src/core/minder.event.js
View file @
d896284a
...
@@ -13,7 +13,7 @@ kity.extendClass( Minder, {
...
@@ -13,7 +13,7 @@ kity.extendClass( Minder, {
},
},
// TODO: mousemove lazy bind
// TODO: mousemove lazy bind
_bindPaperEvents
:
function
()
{
_bindPaperEvents
:
function
()
{
this
.
_paper
.
on
(
'click dblclick mousedown contextmenu mouseup mousemove mousewheel touchstart touchmove touchend'
,
this
.
_firePharse
.
bind
(
this
)
);
this
.
_paper
.
on
(
'click dblclick mousedown contextmenu mouseup mousemove mousewheel
DOMMouseScroll
touchstart touchmove touchend'
,
this
.
_firePharse
.
bind
(
this
)
);
if
(
window
)
{
if
(
window
)
{
window
.
addEventListener
(
'resize'
,
this
.
_firePharse
.
bind
(
this
)
);
window
.
addEventListener
(
'resize'
,
this
.
_firePharse
.
bind
(
this
)
);
}
}
...
@@ -27,6 +27,10 @@ kity.extendClass( Minder, {
...
@@ -27,6 +27,10 @@ kity.extendClass( Minder, {
_firePharse
:
function
(
e
)
{
_firePharse
:
function
(
e
)
{
var
beforeEvent
,
preEvent
,
executeEvent
;
var
beforeEvent
,
preEvent
,
executeEvent
;
if
(
e
.
type
==
'DOMMouseScroll'
)
{
e
.
type
=
'mousewheel'
;
e
.
wheelDelta
=
e
.
originEvent
.
wheelDelta
=
e
.
originEvent
.
detail
*
120
;
}
beforeEvent
=
new
MinderEvent
(
'before'
+
e
.
type
,
e
,
true
);
beforeEvent
=
new
MinderEvent
(
'before'
+
e
.
type
,
e
,
true
);
if
(
this
.
_fire
(
beforeEvent
)
)
{
if
(
this
.
_fire
(
beforeEvent
)
)
{
...
@@ -67,17 +71,17 @@ kity.extendClass( Minder, {
...
@@ -67,17 +71,17 @@ kity.extendClass( Minder, {
var
callbacks
=
this
.
_eventCallbacks
[
e
.
type
.
toLowerCase
()
]
||
[];
var
callbacks
=
this
.
_eventCallbacks
[
e
.
type
.
toLowerCase
()
]
||
[];
if
(
status
)
{
if
(
status
)
{
callbacks
=
callbacks
.
concat
(
this
.
_eventCallbacks
[
status
+
'.'
+
e
.
type
.
toLowerCase
()
]
||
[]
);
callbacks
=
callbacks
.
concat
(
this
.
_eventCallbacks
[
status
+
'.'
+
e
.
type
.
toLowerCase
()
]
||
[]
);
}
}
if
(
callbacks
.
length
==
0
)
{
if
(
callbacks
.
length
===
0
)
{
return
;
return
;
}
}
var
lastStatus
=
this
.
getStatus
();
var
lastStatus
=
this
.
getStatus
();
for
(
var
i
=
0
;
i
<
callbacks
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
callbacks
.
length
;
i
++
)
{
...
@@ -92,18 +96,18 @@ kity.extendClass( Minder, {
...
@@ -92,18 +96,18 @@ kity.extendClass( Minder, {
},
},
on
:
function
(
name
,
callback
)
{
on
:
function
(
name
,
callback
)
{
var
km
=
this
;
var
km
=
this
;
utils
.
each
(
name
.
split
(
/
\s
+/
),
function
(
i
,
n
)
{
utils
.
each
(
name
.
split
(
/
\s
+/
),
function
(
i
,
n
)
{
km
.
_listen
(
n
.
toLowerCase
(),
callback
);
km
.
_listen
(
n
.
toLowerCase
(),
callback
);
});
}
);
return
this
;
return
this
;
},
},
off
:
function
(
name
,
callback
)
{
off
:
function
(
name
,
callback
)
{
var
types
=
name
.
split
(
/
\s
+/
);
var
types
=
name
.
split
(
/
\s
+/
);
var
i
,
j
,
callbacks
,
removeIndex
;
var
i
,
j
,
callbacks
,
removeIndex
;
for
(
i
=
0
;
i
<
types
.
length
;
i
++
)
{
for
(
i
=
0
;
i
<
types
.
length
;
i
++
)
{
callbacks
=
this
.
_eventCallbacks
[
types
[
i
].
toLowerCase
()
];
callbacks
=
this
.
_eventCallbacks
[
types
[
i
].
toLowerCase
()
];
if
(
callbacks
)
{
if
(
callbacks
)
{
removeIndex
=
null
;
removeIndex
=
null
;
for
(
j
=
0
;
j
<
callbacks
.
length
;
j
++
)
{
for
(
j
=
0
;
j
<
callbacks
.
length
;
j
++
)
{
...
...
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