diff options
author | Annabel Dunstone <annabel.dunstone@gmail.com> | 2016-08-03 23:04:40 +0300 |
---|---|---|
committer | Annabel Dunstone <annabel.dunstone@gmail.com> | 2016-08-17 19:18:53 +0300 |
commit | f97939a791ae1e71f8e9d366cdfe106decb9545e (patch) | |
tree | c8335923f2b0f16a2e10d19fa51d12cc5e59315d /app/assets/javascripts/build.js | |
parent | 5bfca3b16d12e63675233f1d91e74db35c2545e3 (diff) |
Selecting stage updates builds dropdown
Diffstat (limited to 'app/assets/javascripts/build.js')
-rw-r--r-- | app/assets/javascripts/build.js | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/app/assets/javascripts/build.js b/app/assets/javascripts/build.js index 3482c580edb..baa91e221e8 100644 --- a/app/assets/javascripts/build.js +++ b/app/assets/javascripts/build.js @@ -13,13 +13,14 @@ this.state = state1; this.hideSidebar = bind(this.hideSidebar, this); this.toggleSidebar = bind(this.toggleSidebar, this); + this.updateDropdown = bind(this.updateDropdown, this); clearInterval(Build.interval); this.bp = Breakpoints.get(); - this.hideSidebar(); - this.displayTestStatuses(); $('.js-build-sidebar').niceScroll(); + this.hideSidebar(); $(document).off('click', '.js-sidebar-build-toggle').on('click', '.js-sidebar-build-toggle', this.toggleSidebar); $(window).off('resize.build').on('resize.build', this.hideSidebar); + $(document).on('click', '.stage-item', this.updateDropdown); this.updateArtifactRemoveDate(); if ($('#build-trace').length) { this.getInitialBuildTrace(); @@ -133,12 +134,16 @@ } }; - Build.prototype.displayTestStatuses = function() { - $jobs = $('.build-job'); - jobjects = $jobs.map(function () { - return $(this).data(); - }); - console.log(jobjects); + Build.prototype.populateJobDropdown = function(stage) { + $('.build-job').hide(); + $('.build-job[data-stage="' + stage + '"]').show(); + }; + + Build.prototype.updateDropdown = function(e) { + e.preventDefault(); + var stage = e.target.text; + $('.stage-selection').text(stage); + this.populateJobDropdown(stage); }; return Build; |