better url handling
This commit is contained in:
parent
4f96f6d7d6
commit
60ea16271c
|
@ -1,2 +0,0 @@
|
|||
#!/bin/sh
|
||||
grep -rli "$1" | xargs -i@ sed -i "s/${1}/s\/${1}/g" @
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
grep -rli "${1}" * | xargs -i@ sed -i "s/${1}/s\/${1}/g" @
|
||||
|
|
@ -3,25 +3,31 @@
|
|||
*/
|
||||
import { buildPopUpUrl } from '../../components/windows/popUpAvailable';
|
||||
|
||||
function setFullTitle(windowType, title) {
|
||||
const name = windowType[0] + windowType.substring(1).toLowerCase();
|
||||
document.title = (title) ? `${name} - ${title}` : name;
|
||||
}
|
||||
|
||||
export default (store) => (next) => (action) => {
|
||||
const ret = next(action);
|
||||
|
||||
switch (action.type) {
|
||||
case 'SET_WIN_TITLE': {
|
||||
const { windowType } = store.getState().popup;
|
||||
const { title } = action;
|
||||
const name = windowType[0] + windowType.substring(1).toLowerCase();
|
||||
document.title = (title) ? `${name} - ${title}` : name;
|
||||
const { windowType, title } = store.getState().popup;
|
||||
setFullTitle(windowType, title);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'CHANGE_WIN_TYPE':
|
||||
case 'SET_WIN_ARGS': {
|
||||
const {
|
||||
args,
|
||||
windowType,
|
||||
title,
|
||||
} = store.getState().popup;
|
||||
const url = buildPopUpUrl(windowType, args);
|
||||
window.history.pushState({}, undefined, url);
|
||||
setFullTitle(windowType, title);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,14 @@ export default function popup(
|
|||
};
|
||||
}
|
||||
|
||||
case 'SET_WIN_TITLE': {
|
||||
const { title } = action;
|
||||
return {
|
||||
...state,
|
||||
title,
|
||||
};
|
||||
}
|
||||
|
||||
case 'CHANGE_WIN_TYPE': {
|
||||
const {
|
||||
windowType,
|
||||
|
|
Loading…
Reference in New Issue
Block a user