Commit 3ade8de5 authored by Alfredo Sumaran's avatar Alfredo Sumaran

Explain regular expression

parent f2ad7aab
class GitLabCrop class GitLabCrop
# Matches everything but the file name
FILENAMEREGEX = /^.*[\\\/]/
constructor: (input, opts = {}) -> constructor: (input, opts = {}) ->
@fileInput = $(input) @fileInput = $(input)
...@@ -131,7 +134,7 @@ class GitLabCrop ...@@ -131,7 +134,7 @@ class GitLabCrop
setPreview: -> setPreview: ->
@previewImage.attr('src', @dataURL) @previewImage.attr('src', @dataURL)
filename = @fileInput.val().replace(/^.*[\\\/]/, '') filename = @fileInput.val().replace(FILENAMEREGEX, '')
@filename.text(filename) @filename.text(filename)
setBlob: -> setBlob: ->
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment