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
diff options
context:
space:
mode:
authorCairo Noleto <caironoleto@gmail.com>2016-07-13 02:18:13 +0300
committerCairo Noleto <caironoleto@gmail.com>2016-07-15 01:36:19 +0300
commit36dc4a5ce74dfd76a4acd7580fabec43ede1a254 (patch)
tree0180131b6b88ea7d27f4675b767b175093bc0cdd /app/assets/javascripts
parentacbcbd4a5bb40358fb74dc11fa77abae000b85c9 (diff)
Allow bulk (un)subscription from issues in issue index
fixies #19747
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/issues-bulk-assignment.js.coffee13
-rw-r--r--app/assets/javascripts/subscription_select.js.coffee18
2 files changed, 25 insertions, 6 deletions
diff --git a/app/assets/javascripts/issues-bulk-assignment.js.coffee b/app/assets/javascripts/issues-bulk-assignment.js.coffee
index 6b0e69dbae7..3d09ea08e3b 100644
--- a/app/assets/javascripts/issues-bulk-assignment.js.coffee
+++ b/app/assets/javascripts/issues-bulk-assignment.js.coffee
@@ -85,12 +85,13 @@ class @IssuableBulkActions
getFormDataAsObject: ->
formData =
update:
- state_event : @form.find('input[name="update[state_event]"]').val()
- assignee_id : @form.find('input[name="update[assignee_id]"]').val()
- milestone_id : @form.find('input[name="update[milestone_id]"]').val()
- issues_ids : @form.find('input[name="update[issues_ids]"]').val()
- add_label_ids : []
- remove_label_ids : []
+ state_event : @form.find('input[name="update[state_event]"]').val()
+ assignee_id : @form.find('input[name="update[assignee_id]"]').val()
+ milestone_id : @form.find('input[name="update[milestone_id]"]').val()
+ issues_ids : @form.find('input[name="update[issues_ids]"]').val()
+ subscription_event : @form.find('input[name="update[subscription_event]"]').val()
+ add_label_ids : []
+ remove_label_ids : []
if @willUpdateLabels
@getLabelsToApply().map (id) ->
diff --git a/app/assets/javascripts/subscription_select.js.coffee b/app/assets/javascripts/subscription_select.js.coffee
new file mode 100644
index 00000000000..e5eb7a50d80
--- /dev/null
+++ b/app/assets/javascripts/subscription_select.js.coffee
@@ -0,0 +1,18 @@
+class @SubscriptionSelect
+ constructor: ->
+ $('.js-subscription-event').each (i, el) ->
+ fieldName = $(el).data("field-name")
+
+ $(el).glDropdown(
+ selectable: true
+ fieldName: fieldName
+ toggleLabel: (selected, el, instance) =>
+ label = 'Subscription'
+ $item = instance.dropdown.find('.is-active')
+ label = $item.text() if $item.length
+ label
+ clicked: (item, $el, e)->
+ e.preventDefault()
+ id: (obj, el) ->
+ $(el).data("id")
+ )