# HG changeset patch # User nowmad@23.1.168.192.in-addr.arpa # Date 1450448512 -3600 # Node ID 0889740f79c2db0c166ee4e08556b1b79de1c699 # Parent 32af4f9922c92429f96eeee0fc7325512ee1f161 on page load, hilight the objects corresponding to the query params diff -r 32af4f9922c9 -r 0889740f79c2 cms/app-client/app/components/visu-chrono.js --- a/cms/app-client/app/components/visu-chrono.js Fri Dec 18 15:21:00 2015 +0100 +++ b/cms/app-client/app/components/visu-chrono.js Fri Dec 18 15:21:52 2015 +0100 @@ -3,6 +3,11 @@ export default Ember.Component.extend({ didInsertElement: function(){ var _this = this; + + if (this.get('container').lookup('controller:application').date !== null){ + this.highlightQuery(this.get('container').lookup('controller:application').date.split(',')); + } + var isMouseDown = false, isHighlighted; $("#our_table li").mousedown(function () { @@ -30,5 +35,11 @@ }).get().join(','); dateQuery = (dateQuery == "") ? null : dateQuery; this.sendAction('action', dateQuery); + }, + highlightQuery: function(list){ + list.map(function(elt, index){ + var year = Math.floor(parseInt(elt)/10)*10; + $("#"+year+" ."+(parseInt(elt)-year)).toggleClass("highlighted", true); + }); } }); diff -r 32af4f9922c9 -r 0889740f79c2 cms/app-client/app/templates/components/visu-chrono.hbs --- a/cms/app-client/app/templates/components/visu-chrono.hbs Fri Dec 18 15:21:00 2015 +0100 +++ b/cms/app-client/app/templates/components/visu-chrono.hbs Fri Dec 18 15:21:52 2015 +0100 @@ -1,74 +1,74 @@