Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 4a69761

Browse files
author
vikasrohit
committed
AS#145319139176894, Submissions: File picker not working on dev
-- Fixed file picker loading
1 parent 985c89e commit 4a69761

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

app/directives/tc-fp-file-input/tc-fp-file-input.directive.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,19 @@ import _ from 'lodash'
5454
scope.onSuccess(event.originalEvent || event)
5555
$rootScope.$apply()
5656
})
57-
element = element.length ? element[0] : element
58-
for (key in attrs.$attr) {
59-
value = attrs.$attr[key]
60-
element.setAttribute(value, attrs[key])
61-
}
62-
filepickerService.constructWidget(element)
57+
58+
var input = element.find('input')
59+
input = input.length ? input[0] : input
60+
input.setAttribute('data-fp-maxSize', scope.maxSize)
61+
input.setAttribute('data-fp-services', scope.fpServices)
62+
input.setAttribute('data-fp-button-class', 'tc-btn')
63+
input.setAttribute('data-fp-multiple', false)
64+
input.setAttribute('data-fp-extensions', scope.extensions)
65+
input.setAttribute('data-fp-store-location', 's3')
66+
input.setAttribute('data-fp-store-container', scope.fpContainer)
67+
input.setAttribute('data-fp-store-path', scope.filePath)
68+
69+
filepickerService.constructWidget(input)
6370

6471
scope.onSuccess = function(event) {
6572
var fpFile = event.fpfile

app/directives/tc-fp-file-input/tc-fp-file-input.jade

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,5 @@
77
span.tc-label__asterisk.lowercase(ng-if="mandatory") #[span *]mandatory
88
input.tc-file-field__input(
99
type="filepicker-dragdrop",
10-
data-fp-maxSize="{{maxSize}}",
11-
data-fp-button-class="tc-btn",
12-
data-fp-services="{{fpServices}}",
13-
data-fp-multiple="false",
14-
data-fp-extensions="{{extensions}}",
15-
data-fp-store-location="s3",
16-
data-fp-store-container="{{fpContainer}}",
17-
data-fp-store-path="{{filePath}}",
1810
on-success="onFileSeleted(event.fpfile)"
1911
)

0 commit comments

Comments
 (0)