aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorjpl2017-03-01 17:16:15 +0100
committerjpl2017-03-01 17:16:28 +0100
commit49a472835bf5bfe57c711dfd20b8e1a44afd6264 (patch)
tree28dfa684f901160a37781ecd4f952e4218a5b4a9 /app/assets/javascripts
parenta31a230a8e019fdf0d3fe948803eff73cccfd333 (diff)
downloadchouette-core-49a472835bf5bfe57c711dfd20b8e1a44afd6264.tar.bz2
Refs #2623: updating selectable_table component, with js params injection to url
Diffstat (limited to 'app/assets/javascripts')
-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'