Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-03-19 18:39:34 +0300
committerJacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home>2016-03-25 16:48:12 +0300
commit6f48cb860957676273d1e7bfc1195195599ab0f1 (patch)
treee50d42d20c6da2d983acd9634a0a4129a398ee21 /app
parent531331f79d63a736efd1d40d7ad40b5a277327fd (diff)
Fix broken functionality in sidebar after merge.
Added nice animations too.
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/gl_dropdown.js.coffee2
-rw-r--r--app/assets/javascripts/labels_select.js.coffee18
-rw-r--r--app/assets/javascripts/lib/animate.js.coffee13
-rw-r--r--app/assets/javascripts/milestone_select.js.coffee16
-rw-r--r--app/assets/javascripts/users_select.js.coffee3
-rw-r--r--app/assets/stylesheets/application.scss1
-rw-r--r--app/assets/stylesheets/pages/issuable.scss2
-rw-r--r--app/views/shared/issuable/_sidebar.html.haml4
8 files changed, 42 insertions, 17 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js.coffee b/app/assets/javascripts/gl_dropdown.js.coffee
index 3694407c31a..d1438aed7f6 100644
--- a/app/assets/javascripts/gl_dropdown.js.coffee
+++ b/app/assets/javascripts/gl_dropdown.js.coffee
@@ -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
diff --git a/app/assets/javascripts/labels_select.js.coffee b/app/assets/javascripts/labels_select.js.coffee
index 78ee0ba467a..285e15feffe 100644
--- a/app/assets/javascripts/labels_select.js.coffee
+++ b/app/assets/javascripts/labels_select.js.coffee
@@ -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="'+
@@ -147,7 +147,7 @@ class @LabelsSelect
$loading.fadeIn()
$.ajax(
type: 'PUT'
- url: issueURL
+ url: issueUpdateURL
dataType: 'JSON'
data: data
).done (data) ->
@@ -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) ->
@@ -224,6 +232,8 @@ class @LabelsSelect
hidden: ->
$selectbox.hide()
$value.show()
+ if $dropdown.hasClass 'js-multiselect'
+ saveLabelData()
multiSelect: $dropdown.hasClass 'js-multiselect'
diff --git a/app/assets/javascripts/lib/animate.js.coffee b/app/assets/javascripts/lib/animate.js.coffee
new file mode 100644
index 00000000000..8f892b5a2b9
--- /dev/null
+++ b/app/assets/javascripts/lib/animate.js.coffee
@@ -0,0 +1,13 @@
+((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
diff --git a/app/assets/javascripts/milestone_select.js.coffee b/app/assets/javascripts/milestone_select.js.coffee
index 6c7a3a5aa78..52fa5740c49 100644
--- a/app/assets/javascripts/milestone_select.js.coffee
+++ b/app/assets/javascripts/milestone_select.js.coffee
@@ -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 = {}
@@ -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
diff --git a/app/assets/javascripts/users_select.js.coffee b/app/assets/javascripts/users_select.js.coffee
index 5fe8f73ce2d..2f6d365237b 100644
--- a/app/assets/javascripts/users_select.js.coffee
+++ b/app/assets/javascripts/users_select.js.coffee
@@ -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('/')
diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss
index e2d590f4df4..69b3b6586de 100644
--- a/app/assets/stylesheets/application.scss
+++ b/app/assets/stylesheets/application.scss
@@ -10,6 +10,7 @@
*= require dropzone/basic
*= require cal-heatmap
*= require cropper.css
+ *= require animate
*/
/*
diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss
index 459c1840ec1..467df4c3653 100644
--- a/app/assets/stylesheets/pages/issuable.scss
+++ b/app/assets/stylesheets/pages/issuable.scss
@@ -255,7 +255,7 @@
.dropdown-menu-toggle {
width: 100%;
- padding-top: 0;
+ padding-top: 6px;
}
.open .dropdown-menu {
diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml
index d702c8ec1fe..46a7f325441 100644
--- a/app/views/shared/issuable/_sidebar.html.haml
+++ b/app/views/shared/issuable/_sidebar.html.haml
@@ -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