equal
deleted
inserted
replaced
|
1 import Ember from 'ember'; |
|
2 |
|
3 export default Ember.Component.extend({ |
|
4 didInsertElement: function(){ |
|
5 var isMouseDown = false, |
|
6 isHighlighted; |
|
7 $("#our_table li") |
|
8 .mousedown(function () { |
|
9 isMouseDown = true; |
|
10 $(this).toggleClass("highlighted"); |
|
11 isHighlighted = $(this).hasClass("highlighted"); |
|
12 return false; // prevent text selection |
|
13 }) |
|
14 .mouseover(function () { |
|
15 if (isMouseDown) { |
|
16 $(this).toggleClass("highlighted", isHighlighted); |
|
17 } |
|
18 }) |
|
19 .bind("selectstart", function () { |
|
20 return false; |
|
21 }) |
|
22 |
|
23 $(document) |
|
24 .mouseup(function () { |
|
25 isMouseDown = false; |
|
26 }); |
|
27 } |
|
28 }); |