1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-05 17:02:47 +00:00

solve compatibility problems

This commit is contained in:
shanshuirenjia
2019-06-04 16:18:32 +08:00
parent 9ba1278eca
commit a0d5ad5e93
6 changed files with 27 additions and 7 deletions

View File

@@ -229,6 +229,13 @@ export const Utils = {
navigator.userAgent.indexOf('Chrome') > -1;
},
isIEBrower: function() {
var userAgent = navigator.userAgent;
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1;
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
return isIE || isIE11;
},
getDefaultLibIconUrl: function(isBig) {
let size = Utils.isHiDPI() ? 48 : 24;
size = isBig ? 256 : size;
@@ -871,6 +878,14 @@ export const Utils = {
password += possible.charAt(Math.floor(Math.random() * possible.length));
}
return password;
},
getEventData: function(event, data) {
if (event.target.dataset) {
return event.target.dataset[data];
}
return event.target.getAttribute('data-' + data);
}
};