File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 53
53
54
54
<script >
55
55
import { on , off } from ' element-ui/src/utils/dom' ;
56
- import { rafThrottle } from ' element-ui/src/utils/util' ;
56
+ import { rafThrottle , isFirefox } from ' element-ui/src/utils/util' ;
57
57
58
58
const Mode = {
59
59
CONTAIN : {
@@ -66,8 +66,7 @@ const Mode = {
66
66
}
67
67
};
68
68
69
- const isFirefox = !! window .navigator .userAgent .match (/ firefox/ i );
70
- const mousewheelEventName = isFirefox ? ' DOMMouseScroll' : ' mousewheel' ;
69
+ const mousewheelEventName = isFirefox () ? ' DOMMouseScroll' : ' mousewheel' ;
71
70
72
71
export default {
73
72
name: ' elImageViewer' ,
Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ export const isEdge = function() {
122
122
return ! Vue . prototype . $isServer && navigator . userAgent . indexOf ( 'Edge' ) > - 1 ;
123
123
} ;
124
124
125
+ export const isFirefox = function ( ) {
126
+ return ! Vue . prototype . $isServer && ! ! window . navigator . userAgent . match ( / f i r e f o x / i) ;
127
+ } ;
128
+
125
129
export const autoprefixer = function ( style ) {
126
130
if ( typeof style !== 'object' ) return style ;
127
131
const rules = [ 'transform' , 'transition' , 'animation' ] ;
You can’t perform that action at this time.
0 commit comments