aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts/selectable_table.coffee
diff options
context:
space:
mode:
authorXinhui2017-03-03 17:50:58 +0100
committerXinhui2017-03-03 17:50:58 +0100
commitbd1458253c7956dd4a07dd3017e6cbb5004c56f1 (patch)
treef70e2152f19b8dd418cef3a9cde6bebd06f4d0c0 /app/assets/javascripts/selectable_table.coffee
parentdd6c19075007302c1ccf33a3e94a98162c721d62 (diff)
parentb74d373bc477fd60b083fa9a5b79b346cd9d07de (diff)
downloadchouette-core-bd1458253c7956dd4a07dd3017e6cbb5004c56f1.tar.bz2
Merge branch 'master' into staging
Diffstat (limited to 'app/assets/javascripts/selectable_table.coffee')
-rw-r--r--app/assets/javascripts/selectable_table.coffee15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/selectable_table.coffee b/app/assets/javascripts/selectable_table.coffee
index 1b4b95c0b..84475857e 100644
--- a/app/assets/javascripts/selectable_table.coffee
+++ b/app/assets/javascripts/selectable_table.coffee
@@ -28,11 +28,26 @@
elm = selection.indexOf(e.currentTarget.id)
selection.splice(elm, 1)
+ # console.log(selection)
+
# Updating toolbox, according to selection
if selection.length > 0
toolbox
.removeClass 'noselect'
.children('.info-msg').children('span').text(selection.length)
+
+ # Injecting selection into action urls
+ toolbox.find('.st_action').each ->
+ actionURL = $(this).children('a').attr('data-path')
+
+ newSelection = []
+ i = 0
+ while i < selection.length
+ newSelection[i] = 'referentials[]=' + selection[i] + ''
+ i++
+
+ $(this).children('a').attr('href', actionURL + '?' + newSelection.join('&'))
+
else
toolbox
.addClass 'noselect'