diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-08-17 21:10:09 +0300 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-08-17 21:10:09 +0300 |
commit | d8654744cd6c8fa4cbe4617c2428cd79d4bd5179 (patch) | |
tree | 159d92727944184792c939210b5b73aaf348336a /app/assets/javascripts/merge_request_tabs.js | |
parent | 4a13aa9f34ab4114bc485e1ca8fa0db8daa0394b (diff) | |
parent | 46dc00631aeae34c1964888625c5ccd04da6b4c1 (diff) |
Merge branch 'master' into diff-line-comment-vuejs
Diffstat (limited to 'app/assets/javascripts/merge_request_tabs.js')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index 75aa6c7a491..ab9d2367fc7 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -9,6 +9,8 @@ MergeRequestTabs.prototype.buildsLoaded = false; + MergeRequestTabs.prototype.pipelinesLoaded = false; + MergeRequestTabs.prototype.commitsLoaded = false; function MergeRequestTabs(opts) { @@ -50,6 +52,9 @@ } else if (action === 'builds') { this.loadBuilds($target.attr('href')); this.expandView(); + } else if (action === 'pipelines') { + this.loadPipelines($target.attr('href')); + this.expandView(); } else { this.expandView(); } @@ -82,7 +87,7 @@ action = 'notes'; } this.currentAction = action; - new_state = this._location.pathname.replace(/\/(commits|diffs|builds)(\.html)?\/?$/, ''); + new_state = this._location.pathname.replace(/\/(commits|diffs|builds|pipelines)(\.html)?\/?$/, ''); if (action !== 'notes') { new_state += "/" + action; } @@ -183,6 +188,21 @@ }); }; + MergeRequestTabs.prototype.loadPipelines = function(source) { + if (this.pipelinesLoaded) { + return; + } + return this._get({ + url: source + ".json", + success: function(data) { + $('#pipelines').html(data.html); + gl.utils.localTimeAgo($('.js-timeago', '#pipelines')); + this.pipelinesLoaded = true; + return this.scrollToElement("#pipelines"); + }.bind(this) + }); + }; + MergeRequestTabs.prototype.toggleLoading = function(status) { return $('.mr-loading-status .loading').toggle(status); }; |