Show More
Commit Description:
## Bootstrapify...
Commit Description:
## Bootstrapify
* submit error message
* bootstrap switch for announcement
References:
File last commit:
Show/Diff file:
Action:
app/assets/javascripts/custom.js.coffee
| 26 lines
| 659 B
| text/coffeescript
| CoffeeScriptLexer
|
r555 | $(document).on 'change', '.btn-file :file', -> | |||
input = $(this) | ||||
numFiles = if input.get(0).files then input.get(0).files.length else 1 | ||||
label = input.val().replace(/\\/g, '/').replace(/.*\//, '') | ||||
input.trigger 'fileselect', [ | ||||
numFiles | ||||
label | ||||
] | ||||
return | ||||
# document ready | ||||
r554 | $ -> | |||
$(".select2").select2() | ||||
r555 | $(".bootstrap-switch").bootstrapSwitch() | |||
$('.btn-file :file').on 'fileselect', (event, numFiles, label) -> | ||||
input = $(this).parents('.input-group').find(':text') | ||||
log = if numFiles > 1 then numFiles + ' files selected' else label | ||||
if input.length | ||||
input.val log | ||||
else | ||||
if log | ||||
alert log | ||||
return | ||||
return | ||||