diff -r aca69a9db743 -r 9ef0952033e0 cms/app-client/app/components/visu-chrono.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cms/app-client/app/components/visu-chrono.js Thu Dec 10 17:00:02 2015 +0100 @@ -0,0 +1,28 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + didInsertElement: function(){ + var isMouseDown = false, + isHighlighted; + $("#our_table li") + .mousedown(function () { + isMouseDown = true; + $(this).toggleClass("highlighted"); + isHighlighted = $(this).hasClass("highlighted"); + return false; // prevent text selection + }) + .mouseover(function () { + if (isMouseDown) { + $(this).toggleClass("highlighted", isHighlighted); + } + }) + .bind("selectstart", function () { + return false; + }) + + $(document) + .mouseup(function () { + isMouseDown = false; + }); + } +});