cms/app-client/app/components/visu-chrono.js
author nowmad@nowmads-macbook-pro.local
Thu, 10 Dec 2015 17:00:59 +0100
changeset 49 66739650678f
parent 48 9ef0952033e0
child 54 5b2b161dd4ce
permissions -rw-r--r--
update main index to add the 2 kind of menu (hash and history) and set the locationType to hash

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;
      });
  }
});