# HG changeset patch # User Chloe Laisne # Date 1467900719 -7200 # Node ID c928f6190771e460f8d132d22a21c6b2ad44a08f # Parent 0ff47a9c5da2fb57c456078aedd143560c1b1440 Select row in chronology diff -r 0ff47a9c5da2 -r c928f6190771 cms/app-client/app/components/visu-chrono.js --- a/cms/app-client/app/components/visu-chrono.js Thu Jul 07 11:06:11 2016 +0200 +++ b/cms/app-client/app/components/visu-chrono.js Thu Jul 07 16:11:59 2016 +0200 @@ -95,6 +95,33 @@ dates.map(function(date){ Ember.$("#" + date).toggleClass("highlighted", true); }); + }, + + actions : { + + selectDecade: function(decade) { + var array = []; + var next = decade + 10; + var dates = this.get('filter').get('date'); + while(decade < next) { + array.push(decade); + decade ++; + } + if(array.find(function(date){ return dates.indexOf(date) === -1; })) { + array = array.filter(function(value) { + return dates.indexOf(value) === -1; + }); + array = dates.concat(array); + // Ascending sorting. + array.sort(function(a, b) { return a - b; }); + } else { + array = dates.filter(function(value) { + return array.indexOf(value) === -1; + }); + } + this.get('filter').set('date', array); + } + } }); diff -r 0ff47a9c5da2 -r c928f6190771 cms/app-client/app/styles/tabs/chrono.scss --- a/cms/app-client/app/styles/tabs/chrono.scss Thu Jul 07 11:06:11 2016 +0200 +++ b/cms/app-client/app/styles/tabs/chrono.scss Thu Jul 07 16:11:59 2016 +0200 @@ -7,12 +7,12 @@ margin-bottom: 5px; } -#chrono-table .tens { +#chrono-table .decades { color: $medium-grey; font-size: 13px; } -#chrono-table .tens::after { +#chrono-table .decades::after { content: ' -'; } diff -r 0ff47a9c5da2 -r c928f6190771 cms/app-client/app/templates/components/visu-chrono.hbs --- a/cms/app-client/app/templates/components/visu-chrono.hbs Thu Jul 07 11:06:11 2016 +0200 +++ b/cms/app-client/app/templates/components/visu-chrono.hbs Thu Jul 07 16:11:59 2016 +0200 @@ -1,5 +1,5 @@
- 1960 + 1960
- 1970 + 1970
- 1980 + 1980
- 1990 + 1990
- 2000 + 2000
- 2010 + 2010