Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload button and preview bugfixes #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions lib/client/autoform-file.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ Template.afFileUpload.onCreated ->
self = @
@value = new ReactiveVar @data.value

@_stopInterceptValue = false
@_interceptValue = (ctx) =>
unless @_stopInterceptValue
t = Template.instance()
if t.value.get() isnt false and t.value.get() isnt ctx.value and ctx.value?.length > 0
t.value.set ctx.value
@_stopInterceptValue = true

@_insert = (file) ->
collection = getCollection self.data

Expand Down Expand Up @@ -67,7 +59,6 @@ Template.afFileUpload.helpers
file: getDocument @
atts: @atts
file: ->
Template.instance()._interceptValue @
getDocument @
removeFileBtnTemplate: ->
@atts?.removeFileBtnTemplate or 'afFileRemoveFileBtnTemplate'
Expand Down
4 changes: 2 additions & 2 deletions lib/client/autoform-file.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
</template>

<template name="afFileSelectFileBtnTemplate">
<button type="button" class="btn btn-default af-select-file js-af-select-file">
<span class="btn btn-default af-select-file js-af-select-file">
{{label}}
<input type="file" class="js-file" accept="{{accept}}">
</button>
</span>
</template>

<template name="afFileUploadProgress">
Expand Down