Skip to content
This repository was archived by the owner on Nov 20, 2018. It is now read-only.

Commit d3c1739

Browse files
author
Ray Nicholus
committed
fix(button): multiple file selection not possible after first batch selected
fixes #1287
1 parent 6e837af commit d3c1739

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

client/js/button.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ qq.UploadButton = function(o) {
147147
},
148148

149149
setMultiple: function(isMultiple, opt_input) {
150-
var input = this.getInput() || opt_input;
150+
var input = opt_input || this.getInput();
151151

152152
// Temporary workaround for bug in in iOS8 UIWebView that causes the browser to crash
153153
// before the file chooser appears if the file input doesn't contain a multiple attribute.
@@ -178,6 +178,7 @@ qq.UploadButton = function(o) {
178178
}
179179

180180
qq(options.element).removeClass(options.focusClass);
181+
input = null;
181182
input = createInput();
182183
}
183184
});

test/unit/button.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ describe("button.js", function () {
2929
$fixture.append("<div id='foo'></div>");
3030

3131
var button = new qq.UploadButton({
32-
element: $fixture.find("#foo")[0]
32+
element: $fixture.find("#foo")[0],
33+
multiple: true,
34+
ios8BrowserCrashWorkaround: false
3335
});
3436

3537
var input = button.getInput();
36-
var $input = $(input);
3738

3839
button.reset();
39-
assert.notEqual($input[0], button.getInput(),
40+
assert.notEqual(input, button.getInput(),
4041
"resetting the button should clear the element from the DOM");
42+
assert.ok(qq(button.getInput()).hasAttribute("multiple"), "the multiple attribute should be added to new button after reset");
4143
});
4244

4345
it("does add an internal tracker ID to the input button, and re-adds it on reset", function() {

0 commit comments

Comments
 (0)