cms/app-client/app/components/visu-chrono.js
changeset 81 848e4a5ad4d9
parent 77 0889740f79c2
child 92 3437f5191645
equal deleted inserted replaced
80:6e0272a9b3ca 81:848e4a5ad4d9
     3 export default Ember.Component.extend({
     3 export default Ember.Component.extend({
     4   didInsertElement: function(){
     4   didInsertElement: function(){
     5     var _this = this;
     5     var _this = this;
     6 
     6 
     7     if (this.get('container').lookup('controller:application').date !== null){
     7     if (this.get('container').lookup('controller:application').date !== null){
     8       this.highlightQuery(this.get('container').lookup('controller:application').date.split(','));
     8       this.highlightQuery(this.get('container').lookup('controller:application').date);
     9     }
     9     }
    10 
    10 
    11     var isMouseDown = false,
    11     var isMouseDown = false,
    12       isHighlighted;
    12       isHighlighted;
    13     $("#our_table li").mousedown(function () {
    13     $("#our_table li").mousedown(function () {
    28     $(document).mouseup(function () {
    28     $(document).mouseup(function () {
    29       isMouseDown = false;
    29       isMouseDown = false;
    30     });
    30     });
    31   },
    31   },
    32   sendUpdate: function(){
    32   sendUpdate: function(){
    33     var dateQuery = $('.highlighted').map(function(index, elt) {
    33     var dateQuery = [];
    34       return parseInt($(elt).parent().attr('id')) + parseInt($(elt).html());
    34     $('.highlighted').map(function(index, elt) {
    35     }).get().join(',');
    35       dateQuery.push(parseInt($(elt).parent().attr('id')) + parseInt($(elt).html()));
    36     dateQuery = (dateQuery == "") ? null : dateQuery;
    36     });
    37     this.sendAction('action', dateQuery);
    37     this.sendAction('action', dateQuery);
    38   },
    38   },
    39   highlightQuery: function(list){
    39   highlightQuery: function(list){
    40     list.map(function(elt, index){
    40     list.map(function(elt, index){
    41       var year = Math.floor(parseInt(elt)/10)*10;
    41       var year = Math.floor(parseInt(elt)/10)*10;