File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -1039,11 +1039,9 @@ ss.SimpleUpload.prototype = {
1039
1039
rerouteClicks : function ( elem ) {
1040
1040
"use strict" ;
1041
1041
1042
- var self = this ;
1042
+ var self = this , detachOver , detachClick ;
1043
1043
1044
- // ss.addEvent() returns a function to detach, which
1045
- // allows us to call elem.off() to remove mouseover listener
1046
- elem . off = ss . addEvent ( elem , 'mouseover' , function ( ) {
1044
+ detachOver = ss . addEvent ( elem , 'mouseover' , function ( ) {
1047
1045
if ( self . _disabled ) {
1048
1046
return ;
1049
1047
}
@@ -1056,6 +1054,21 @@ ss.SimpleUpload.prototype = {
1056
1054
ss . copyLayout ( elem , self . _input . parentNode ) ;
1057
1055
self . _input . parentNode . style . visibility = 'visible' ;
1058
1056
} ) ;
1057
+
1058
+ // Support keyboard interaction
1059
+ detachClick = ss . addEvent ( elem , 'click' , function ( e ) {
1060
+ e . preventDefault ( ) ;
1061
+
1062
+ if ( ! self . _input ) {
1063
+ self . _createInput ( ) ;
1064
+ }
1065
+ self . _overBtn = elem ;
1066
+ self . _input . click ( ) ;
1067
+ } ) ;
1068
+
1069
+ // ss.addEvent() returns a function to detach, which
1070
+ // allows us to call elem.off() to remove mouseover listener
1071
+ elem . off = function ( ) { detachOver ( ) ; detachClick ( ) ; } ;
1059
1072
1060
1073
if ( self . _opts . autoCalibrate && ! ss . isVisible ( elem ) ) {
1061
1074
self . log ( 'Upload button not visible' ) ;
You can’t perform that action at this time.
0 commit comments