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

Commit bb14ffc

Browse files
author
Parth Shah
committed
Merge branch 'feature/file-picker-fix' into dev
2 parents 985c89e + b0b60c3 commit bb14ffc

File tree

4 files changed

+26
-14
lines changed

4 files changed

+26
-14
lines changed

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,20 @@ 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-drag-class', 'tc-fp-file-drag-drop')
64+
input.setAttribute('data-fp-multiple', false)
65+
input.setAttribute('data-fp-extensions', scope.extensions)
66+
input.setAttribute('data-fp-store-location', 's3')
67+
input.setAttribute('data-fp-store-container', scope.fpContainer)
68+
input.setAttribute('data-fp-store-path', scope.filePath)
69+
70+
filepickerService.constructWidget(input)
6371

6472
scope.onSuccess = function(event) {
6573
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
)

app/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ require('../assets/css/directives/challenge-tile.scss')
118118
require('../assets/css/directives/challenge-links.directive.scss')
119119
require('../assets/css/directives/badge-tooltip.scss')
120120
require('../assets/css/directives/tc-banner.scss')
121+
require('../assets/css/directives/tc-fp-file-input.directive.scss')
121122
require('../assets/css/community/statistics.scss')
122123
require('../assets/css/community/members.scss')
123124
require('../assets/css/community/community.scss')
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@import 'topcoder/tc-includes';
2+
3+
tc-fp-file-input {
4+
.tc-btn {
5+
margin-bottom: 5px;
6+
}
7+
8+
.tc-fp-file-drag-drop {
9+
width: calc(100% - 4px);
10+
}
11+
}

0 commit comments

Comments
 (0)