diff --git a/src/fix.sh b/src/fix.sh deleted file mode 100755 index dd63794..0000000 --- a/src/fix.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -grep -rli "$1" | xargs -i@ sed -i "s/${1}/s\/${1}/g" @ diff --git a/src/rep.sh b/src/rep.sh deleted file mode 100755 index 8fd6f84..0000000 --- a/src/rep.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -grep -rli "${1}" * | xargs -i@ sed -i "s/${1}/s\/${1}/g" @ - diff --git a/src/store/middleware/titlePopUp.js b/src/store/middleware/titlePopUp.js index 8ac40d1..b793421 100644 --- a/src/store/middleware/titlePopUp.js +++ b/src/store/middleware/titlePopUp.js @@ -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; } diff --git a/src/store/reducers/popup.js b/src/store/reducers/popup.js index f431987..d7edd31 100644 --- a/src/store/reducers/popup.js +++ b/src/store/reducers/popup.js @@ -66,6 +66,14 @@ export default function popup( }; } + case 'SET_WIN_TITLE': { + const { title } = action; + return { + ...state, + title, + }; + } + case 'CHANGE_WIN_TYPE': { const { windowType,