cms/app-client/app/components/visu-chrono.js
author nowmad@nowmads-macbook-pro.local
Thu, 10 Dec 2015 17:00:02 +0100
changeset 48 9ef0952033e0
child 54 5b2b161dd4ce
permissions -rw-r--r--
add example of visualisation for "chonologie"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
     1
import Ember from 'ember';
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
     2
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
     3
export default Ember.Component.extend({
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
     4
  didInsertElement: function(){
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
     5
    var isMouseDown = false,
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
     6
      isHighlighted;
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
     7
    $("#our_table li")
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
     8
      .mousedown(function () {
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
     9
        isMouseDown = true;
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    10
        $(this).toggleClass("highlighted");
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    11
        isHighlighted = $(this).hasClass("highlighted");
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    12
        return false; // prevent text selection
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    13
      })
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    14
      .mouseover(function () {
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    15
        if (isMouseDown) {
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    16
          $(this).toggleClass("highlighted", isHighlighted);
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    17
        }
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    18
      })
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    19
      .bind("selectstart", function () {
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    20
        return false;
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    21
      })
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    22
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    23
    $(document)
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    24
      .mouseup(function () {
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    25
        isMouseDown = false;
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    26
      });
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    27
  }
9ef0952033e0 add example of visualisation for "chonologie"
nowmad@nowmads-macbook-pro.local
parents:
diff changeset
    28
});