1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 14:50:29 +00:00

Merge branch '7.0'

This commit is contained in:
plt
2019-06-21 16:16:41 +08:00
14 changed files with 170 additions and 87 deletions

View File

@@ -231,8 +231,8 @@ export const Utils = {
isIEBrower: function() { // is ie <= ie11 not include Edge
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;
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;
},
@@ -880,6 +880,21 @@ export const Utils = {
return password;
},
pathNormalize: function(originalPath) {
let oldPath = originalPath.split('/');
let newPath = [];
for (let i = 0; i < oldPath.length; i++) {
if (oldPath[i] === '.' || oldPath[i] === '') {
continue;
} else if (oldPath[i] === '..') {
newPath.pop();
} else {
newPath.push(oldPath[i]);
}
}
return newPath.join('/');
},
getEventData: function(event, data) {
if (event.target.dataset) {
return event.target.dataset[data];