This repository was archived by the owner on Nov 20, 2018. It is now read-only.
File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ qq.UploadButton = function(o) {
147
147
} ,
148
148
149
149
setMultiple : function ( isMultiple , opt_input ) {
150
- var input = this . getInput ( ) || opt_input ;
150
+ var input = opt_input || this . getInput ( ) ;
151
151
152
152
// Temporary workaround for bug in in iOS8 UIWebView that causes the browser to crash
153
153
// before the file chooser appears if the file input doesn't contain a multiple attribute.
@@ -178,6 +178,7 @@ qq.UploadButton = function(o) {
178
178
}
179
179
180
180
qq ( options . element ) . removeClass ( options . focusClass ) ;
181
+ input = null ;
181
182
input = createInput ( ) ;
182
183
}
183
184
} ) ;
Original file line number Diff line number Diff line change @@ -29,15 +29,17 @@ describe("button.js", function () {
29
29
$fixture . append ( "<div id='foo'></div>" ) ;
30
30
31
31
var button = new qq . UploadButton ( {
32
- element : $fixture . find ( "#foo" ) [ 0 ]
32
+ element : $fixture . find ( "#foo" ) [ 0 ] ,
33
+ multiple : true ,
34
+ ios8BrowserCrashWorkaround : false
33
35
} ) ;
34
36
35
37
var input = button . getInput ( ) ;
36
- var $input = $ ( input ) ;
37
38
38
39
button . reset ( ) ;
39
- assert . notEqual ( $ input[ 0 ] , button . getInput ( ) ,
40
+ assert . notEqual ( input , button . getInput ( ) ,
40
41
"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" ) ;
41
43
} ) ;
42
44
43
45
it ( "does add an internal tracker ID to the input button, and re-adds it on reset" , function ( ) {
You can’t perform that action at this time.
0 commit comments