frappe-ui 0.1.111 → 0.1.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -8,6 +8,9 @@ interface UploadOptions {
|
|
|
8
8
|
method?: string
|
|
9
9
|
type?: string
|
|
10
10
|
upload_endpoint?: string
|
|
11
|
+
optimize?: boolean
|
|
12
|
+
max_width?: number
|
|
13
|
+
max_height?: number
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
type EventListenerOption = 'start' | 'progress' | 'finish' | 'error'
|
|
@@ -129,6 +132,16 @@ class FileUploadHandler {
|
|
|
129
132
|
form_data.append('type', options.type)
|
|
130
133
|
}
|
|
131
134
|
|
|
135
|
+
if (options.optimize) {
|
|
136
|
+
form_data.append('optimize', '1')
|
|
137
|
+
if (options.max_width) {
|
|
138
|
+
form_data.append('max_width', options.max_width.toString())
|
|
139
|
+
}
|
|
140
|
+
if (options.max_height) {
|
|
141
|
+
form_data.append('max_height', options.max_height.toString())
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
132
145
|
xhr.send(form_data)
|
|
133
146
|
})
|
|
134
147
|
}
|