From e062a4304c81338903512666929752d56ec0c8c1 Mon Sep 17 00:00:00 2001 From: Mavis Ou Date: Tue, 7 Nov 2017 15:28:26 -0800 Subject: [PATCH] Scroll to top when visiting /add page (#833) * Related to #803 - scroll to top when visiting /add page --- package.json | 2 +- routes.jsx | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b438c68..9529a16 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/routes.jsx b/routes.jsx index 0dd9971..c7d9c53 100644 --- a/routes.jsx +++ b/routes.jsx @@ -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 = ( pageSettings.setCurrentPathname(evt.location.pathname)} /> pageSettings.setScrollPosition()} onLeave={() => pageSettings.setRestore(true)} /> - + { window.scroll(0, 0); }} /> pageSettings.setCurrentPathname(evt.location.pathname)} />