mirror of https://github.com/ElemeFE/element
parent
f7a970c0ba
commit
2364c022ab
|
@ -53,7 +53,7 @@
|
|||
|
||||
<script>
|
||||
import { on, off } from 'element-ui/src/utils/dom';
|
||||
import { rafThrottle } from 'element-ui/src/utils/util';
|
||||
import { rafThrottle, isFirefox } from 'element-ui/src/utils/util';
|
||||
|
||||
const Mode = {
|
||||
CONTAIN: {
|
||||
|
@ -66,8 +66,7 @@ const Mode = {
|
|||
}
|
||||
};
|
||||
|
||||
const isFirefox = !!window.navigator.userAgent.match(/firefox/i);
|
||||
const mousewheelEventName = isFirefox ? 'DOMMouseScroll' : 'mousewheel';
|
||||
const mousewheelEventName = isFirefox() ? 'DOMMouseScroll' : 'mousewheel';
|
||||
|
||||
export default {
|
||||
name: 'elImageViewer',
|
||||
|
|
|
@ -122,6 +122,10 @@ export const isEdge = function() {
|
|||
return !Vue.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1;
|
||||
};
|
||||
|
||||
export const isFirefox = function() {
|
||||
return !Vue.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i);
|
||||
};
|
||||
|
||||
export const autoprefixer = function(style) {
|
||||
if (typeof style !== 'object') return style;
|
||||
const rules = ['transform', 'transition', 'animation'];
|
||||
|
|
Loading…
Reference in New Issue