Skip to content
Snippets Groups Projects
Commit 6f48cb86 authored by Jacob Schatz's avatar Jacob Schatz
Browse files

Fix broken functionality in sidebar after merge.

Added nice animations too.
parent 531331f7
No related branches found
No related tags found
1 merge request!3175Updates sidebar to use new dropdowns for issues and merge requests
Loading
Loading
@@ -286,8 +286,8 @@ class GitLabDropdown
selectedObject = @renderedData[selectedIndex]
value = if @options.id then @options.id(selectedObject, el) else selectedObject.id
field = @dropdown.parent().find("input[name='#{fieldName}'][value='#{value}']")
if el.hasClass(ACTIVE_CLASS)
el.removeClass(ACTIVE_CLASS)
field.remove()
else
fieldName = @options.fieldName
Loading
Loading
Loading
Loading
@@ -28,8 +28,8 @@ class @LabelsSelect
# Suggested colors in the dropdown to chose from pre-chosen colors
$('.suggest-colors-dropdown a').on 'click', (e) ->
 
issueURLSplit = issueURL.split('/') if issueURL?
if issueURL
issueURLSplit = issueUpdateURL.split('/') if issueUpdateURL?
if issueUpdateURL
labelHTMLTemplate = _.template(
'<% _.each(labels, function(label){ %>'+
'<a href="'+
Loading
Loading
@@ -147,7 +147,7 @@ class @LabelsSelect
$loading.fadeIn()
$.ajax(
type: 'PUT'
url: issueURL
url: issueUpdateURL
dataType: 'JSON'
data: data
).done (data) ->
Loading
Loading
@@ -160,7 +160,15 @@ class @LabelsSelect
href = $value
.show()
.html(template)
>>>>>>> Add multi select stay open functionality
$value
.find('a')
.each((i) ->
setTimeout(=>
glAnimate($(@), 'pulse')
,200 * i
)
)
 
$dropdown.glDropdown(
data: (term, callback) ->
Loading
Loading
@@ -224,6 +232,8 @@ class @LabelsSelect
hidden: ->
$selectbox.hide()
$value.show()
if $dropdown.hasClass 'js-multiselect'
saveLabelData()
 
multiSelect: $dropdown.hasClass 'js-multiselect'
 
Loading
Loading
((w) ->
w.glAnimate = ($el, animation, done) ->
$el
.removeClass()
.addClass(animation + ' animated')
.one 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', ->
$(this).removeClass()
return
return
return
) window
\ No newline at end of file
Loading
Loading
@@ -67,8 +67,7 @@ class @MilestoneSelect
if $dropdown.hasClass "js-filter-submit"
$dropdown.parents('form').submit()
else
selected = $dropdown
.closest('.selectbox')
selected = $selectbox
.find('input[type="hidden"]')
.val()
data = {}
Loading
Loading
@@ -83,16 +82,15 @@ class @MilestoneSelect
).done (data) ->
$loading.fadeOut()
$selectbox.hide()
href = $value
$milestoneLink = $value
.show()
.find('.milestone-title')
.text(data.milestone.title)
.end()
.find('a')
href = $milestoneLink
.text(data.milestone.title)
.attr('href')
splitHref = href.split('/')
splitHref[splitHref.length - 1] = data.id
$value
.find('a')
splitHref[splitHref.length - 1] = data.milestone.iid
$milestoneLink
.attr('href',splitHref.join('/'))
)
\ No newline at end of file
Loading
Loading
@@ -105,6 +105,9 @@ class @UsersSelect
.find('.author')
.text(data.assignee.name)
.end()
.find('.username')
.text("@#{data.assignee.username}")
.end()
.find('a')
.attr('href')
splitHref = href.split('/')
Loading
Loading
Loading
Loading
@@ -10,6 +10,7 @@
*= require dropzone/basic
*= require cal-heatmap
*= require cropper.css
*= require animate
*/
 
/*
Loading
Loading
Loading
Loading
@@ -255,7 +255,7 @@
.dropdown-menu-toggle {
width: 100%;
padding-top: 0;
padding-top: 6px;
}
 
.open .dropdown-menu {
Loading
Loading
Loading
Loading
@@ -2,9 +2,9 @@
.issuable-sidebar
.block.issuable-sidebar-header
- if issuable.to_ability_name == 'merge_request'
- issuable_url = namespace_project_merge_request_path(@project.namespace, @project, issuable.iid)
- issuable_url = namespace_project_merge_request_path(@project.namespace, @project, issuable.iid, :json)
- else
- issuable_url = namespace_project_issue_path(@project.namespace, @project, issuable.iid)
- issuable_url = namespace_project_issue_path(@project.namespace, @project, issuable.iid, :json)
%span.issuable-count.hide-collapsed.pull-left
= issuable.iid
of
Loading
Loading
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment