diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-03-17 22:30:38 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-03-17 22:30:38 +0300 |
commit | bc70597908c2aa144472b28c891306a6d9390c34 (patch) | |
tree | 0603ed29b8ca813344a3f9dc92b858a24ba3c233 /app/assets/javascripts/gl_crop.js.coffee | |
parent | 9ed1cbf2176bcab22d522373b2830338dc5c7c69 (diff) |
Fix failing spec
Diffstat (limited to 'app/assets/javascripts/gl_crop.js.coffee')
-rw-r--r-- | app/assets/javascripts/gl_crop.js.coffee | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/assets/javascripts/gl_crop.js.coffee b/app/assets/javascripts/gl_crop.js.coffee index 4d990a6416a..6ab0afc184f 100644 --- a/app/assets/javascripts/gl_crop.js.coffee +++ b/app/assets/javascripts/gl_crop.js.coffee @@ -1,7 +1,12 @@ class GitLabCrop - constructor: (el, opts = {}) -> - # Input file - @fileInput = $(el) + constructor: (input, opts = {}) -> + @fileInput = $(input) + + # We should rename to avoid spec to fail + # Form will submit the proper input filed with a file using FormData + @fileInput + .attr('name', "#{@fileInput.attr('name')}-trigger") + .attr('id', "#{@fileInput.attr('id')}-trigger") # Set defaults { |