{"action":"created","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/622","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/622/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/622/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/622/events","html_url":"https://github.com/lhorie/mithril.js/issues/622","id":76431326,"number":622,"title":"What is the valid way to change only part of page on URL change using m.route?","user":{"login":"AlexeyGrishin","id":2125405,"avatar_url":"https://avatars.githubusercontent.com/u/2125405?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexeyGrishin","html_url":"https://github.com/AlexeyGrishin","followers_url":"https://api.github.com/users/AlexeyGrishin/followers","following_url":"https://api.github.com/users/AlexeyGrishin/following{/other_user}","gists_url":"https://api.github.com/users/AlexeyGrishin/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexeyGrishin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexeyGrishin/subscriptions","organizations_url":"https://api.github.com/users/AlexeyGrishin/orgs","repos_url":"https://api.github.com/users/AlexeyGrishin/repos","events_url":"https://api.github.com/users/AlexeyGrishin/events{/privacy}","received_events_url":"https://api.github.com/users/AlexeyGrishin/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-14T17:31:32Z","updated_at":"2015-05-14T17:52:29Z","closed_at":"2015-05-14T17:49:58Z","body":"Hello,\r\n\r\nI've started using mithril.js in my project and met a problem which I'm not sure how to solve. I use m.route for internal navigation between different pages. But one of the pages is shown in popup over another, and I'd like to have a separate URL for it, i.e. when `/page1` opens page without popup and `/page1/overlay` opens same page with popup over it. I've tried to map both URLs on same component, like that:\r\n\r\n```\r\nm.route(document.getElementById('form'), \"/\", {\r\n  \"/\": Page1,                                           \r\n  \"/:action\": Page1\r\n})\r\n```\r\n\r\nand then inside Page1.view show popup only if `m.route.param('action') == 'overlay'`. It works, but on popup opening/closing it re-creates Page1 component. As that page loads some data by ajax it leads to noticeable flickering.\r\n\r\nHere is jsfiddle which illustrates the problem: when you click on \"open overlay\" or \"close overlay\" the URL in browser address line is changed, but top page is reloaded (it uses timeout to emulate ajax call).\r\nResult: https://fiddle.jshell.net/GRaAL/wvbhf9q8/2/show/light/?/\r\nSource: http://jsfiddle.net/GRaAL/wvbhf9q8/3/\r\n\r\nCould you please point me the valid way to achieve that? Is there way to not re-create component on URL change?\r\n\r\nThank you very much in advance."},"comment":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments/102116658","html_url":"https://github.com/lhorie/mithril.js/issues/622#issuecomment-102116658","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/622","id":102116658,"user":{"login":"barneycarroll","id":83627,"avatar_url":"https://avatars.githubusercontent.com/u/83627?v=3","gravatar_id":"","url":"https://api.github.com/users/barneycarroll","html_url":"https://github.com/barneycarroll","followers_url":"https://api.github.com/users/barneycarroll/followers","following_url":"https://api.github.com/users/barneycarroll/following{/other_user}","gists_url":"https://api.github.com/users/barneycarroll/gists{/gist_id}","starred_url":"https://api.github.com/users/barneycarroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barneycarroll/subscriptions","organizations_url":"https://api.github.com/users/barneycarroll/orgs","repos_url":"https://api.github.com/users/barneycarroll/repos","events_url":"https://api.github.com/users/barneycarroll/events{/privacy}","received_events_url":"https://api.github.com/users/barneycarroll/received_events","type":"User","site_admin":false},"created_at":"2015-05-14T17:52:29Z","updated_at":"2015-05-14T17:52:29Z","body":"> Probably in docs for m.route shall be reference to redraw strategy?\r\n\r\nThat's a good point — this isn't the first time people have been looking for this functionality…"}}