mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 18:30:53 +00:00
change notification popover (#5629)
* change notification popover delete useless test * Update iconfont and user notification ui * change notification dialog detail * format css * update url of all notifications when send notice email --------- Co-authored-by: lian <imwhatiam123@gmail.com>
This commit is contained in:
@@ -1571,4 +1571,34 @@ export const Utils = {
|
||||
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
||||
},
|
||||
|
||||
getUrlSearches() {
|
||||
const search = location.search;
|
||||
let searchParams = {};
|
||||
if (search.length === 0) {
|
||||
return searchParams;
|
||||
}
|
||||
let allSearches = search.split('?')[1];
|
||||
let allSearchesArr = allSearches.split('&');
|
||||
allSearchesArr.forEach(item => {
|
||||
let itemArr = item.split('=');
|
||||
searchParams[itemArr[0]] = decodeURI(itemArr[1]);
|
||||
});
|
||||
return searchParams;
|
||||
},
|
||||
|
||||
// If value is null, delete the search parameter; else, add or update the search parameter.
|
||||
updateSearchParameter(key, value) {
|
||||
const { origin, pathname } = location;
|
||||
const searchParams = this.getUrlSearches();
|
||||
searchParams[key] = value;
|
||||
let newSearch = '?';
|
||||
for (let key in searchParams) {
|
||||
let value = searchParams[key];
|
||||
if (value) {
|
||||
newSearch = newSearch === '?' ? `?${key}=${value}` : `${newSearch}&${key}=${value}`;
|
||||
}
|
||||
}
|
||||
history.replaceState(null, '', origin + pathname + newSearch);
|
||||
},
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user