mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 21:26:07 +10:00
Load related MRs/branches asynchronously
Currently this works by loading the HAML partials via XHR. While this is not the nicest setup it _is_ the easiest setup using the tools we currently have. Loading this data asynchronously doesn't make loading the related MRs/branches itself faster, it merely ensures that loading the issue itself is not slowed down. Fixes gitlab-org/gitlab-ce#14949
This commit is contained in:
@@ -10,6 +10,9 @@ class @Issue
|
||||
@initTaskList()
|
||||
@initIssueBtnEventListeners()
|
||||
|
||||
@initMergeRequests()
|
||||
@initRelatedBranches()
|
||||
|
||||
initTaskList: ->
|
||||
$('.detail-page-description .js-task-list-container').taskList('enable')
|
||||
$(document).on 'tasklist:changed', '.detail-page-description .js-task-list-container', @updateTaskList
|
||||
@@ -69,3 +72,23 @@ class @Issue
|
||||
type: 'PATCH'
|
||||
url: $('form.js-issuable-update').attr('action')
|
||||
data: patchData
|
||||
|
||||
initMergeRequests: ->
|
||||
$container = $('#merge-requests')
|
||||
|
||||
$.getJSON($container.data('url'))
|
||||
.error ->
|
||||
new Flash('Failed to load referenced merge requests', 'alert')
|
||||
.success (data) ->
|
||||
if 'html' of data
|
||||
$container.html(data.html)
|
||||
|
||||
initRelatedBranches: ->
|
||||
$container = $('#related-branches')
|
||||
|
||||
$.getJSON($container.data('url'))
|
||||
.error ->
|
||||
new Flash('Failed to load related branches', 'alert')
|
||||
.success (data) ->
|
||||
if 'html' of data
|
||||
$container.html(data.html)
|
||||
|
||||
Reference in New Issue
Block a user