Scroll to top when visiting /add page (#833)

* Related to #803 - scroll to top when visiting /add page
This commit is contained in:
Mavis Ou 2017-11-07 15:28:26 -08:00 коммит произвёл GitHub
Родитель 45b62a9870
Коммит e062a4304c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 2 добавлений и 4 удалений

Просмотреть файл

@ -30,7 +30,7 @@
"watch:html": "chokidar 'index.html' -c 'npm run build-client:static'",
"watch:js": "chokidar 'main.jsx' 'routes.jsx' 'js/**/*.js' 'components/**/*.jsx' 'pages/**/*.jsx' 'pages/**/*.js' 'webpack.config.js' -c 'npm run build-client:js'",
"test": "run-s test:**",
"test:js": "eslint --config .eslintrc.yaml main.jsx \"js/**/*.js\" \"components/**/*.jsx\" \"pages/**/*.jsx\" \"pages/**/*.js\" webpack.config.js",
"test:js": "eslint --config .eslintrc.yaml \"*.jsx\" \"js/**/*.js\" \"components/**/*.jsx\" \"pages/**/*.jsx\" \"pages/**/*.js\" webpack.config.js",
"test:scss": "stylelint --config .stylelintrc \"components/**/*.scss\" \"pages/**/*.scss\" \"scss/**/*.scss\" --syntax scss",
"postinstall": "npm run build",
"prepare": "npm run snyk-protect"

Просмотреть файл

@ -3,7 +3,6 @@ import ReactGA from 'react-ga';
import { Route, IndexRoute, IndexRedirect } from 'react-router';
import { Helmet } from "react-helmet";
import pageSettings from './js/app-page-settings';
import Service from './js/service.js';
import env from "./config/env.generated.json";
import ProjectLoader from './components/project-loader/project-loader.jsx';
@ -18,7 +17,6 @@ import Search from './pages/search/search.jsx';
import Moderation from './pages/moderation.jsx';
import PublicProfile from './pages/public-profile.jsx';
import MyProfile from './pages/my-profile.jsx';
import Profile from './pages/profile.jsx';
import ProfileEdit from './pages/profile-edit/profile-edit.jsx';
import NotFound from './pages/not-found.jsx';
@ -102,7 +100,7 @@ module.exports = (
<Route path=":issue" component={Issue} onEnter={evt => pageSettings.setCurrentPathname(evt.location.pathname)} />
</Route>
<Route path="entry/:entryId" component={Entry} onEnter={() => pageSettings.setScrollPosition()} onLeave={() => pageSettings.setRestore(true)} />
<Route path="add" component={Add} />
<Route path="add" component={Add} onEnter={() => { window.scroll(0, 0); }} />
<Route path="submitted" component={Submitted} />
<Route path="search" component={Search} onEnter={evt => pageSettings.setCurrentPathname(evt.location.pathname)} />
<Route path="tags">