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