File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ var Menu = (function() {
104
104
onSelectableClick = _ . bind ( this . _onSelectableClick , this ) ;
105
105
this . $node . on ( 'click.tt' , this . selectors . selectable , onSelectableClick ) ;
106
106
this . $node . on ( 'mouseover' , this . selectors . selectable , function ( ) { that . setCursor ( $ ( this ) ) } ) ;
107
+ this . $node . on ( 'mouseleave' , function ( ) { that . _removeCursor ( ) ; } ) ;
107
108
108
109
_ . each ( this . datasets , function ( dataset ) {
109
110
dataset
Original file line number Diff line number Diff line change @@ -33,6 +33,30 @@ describe('Menu', function() {
33
33
} ) ;
34
34
} ) ;
35
35
36
+ describe ( 'when mouseover event is triggered on a selectable' , function ( ) {
37
+ it ( 'should call setCursor' , function ( ) {
38
+ var $selectable ;
39
+ spyOn ( this . view , 'setCursor' ) ;
40
+
41
+ this . view . bind ( ) ;
42
+ $selectable = this . $node . find ( www . selectors . selectable ) . first ( ) ;
43
+ $selectable . trigger ( 'mouseover' ) ;
44
+
45
+ expect ( this . view . setCursor ) . toHaveBeenCalledWith ( $selectable ) ;
46
+ } ) ;
47
+ } ) ;
48
+
49
+ describe ( 'when mouseleave event is triggered on the menu' , function ( ) {
50
+ it ( 'should call _removeCursor' , function ( ) {
51
+ spyOn ( this . view , '_removeCursor' ) ;
52
+
53
+ this . view . bind ( ) ;
54
+ this . $node . trigger ( 'mouseleave' ) ;
55
+
56
+ expect ( this . view . _removeCursor ) . toHaveBeenCalled ( ) ;
57
+ } ) ;
58
+ } ) ;
59
+
36
60
describe ( 'when rendered is triggered on a dataset' , function ( ) {
37
61
it ( 'should add empty class to node if empty' , function ( ) {
38
62
this . dataset . isEmpty . andReturn ( true ) ;
You can’t perform that action at this time.
0 commit comments