From 8e6ec11078ffd08f284891581d3e073aa97ca7b5 Mon Sep 17 00:00:00 2001 From: Peter Fischer Date: Mon, 9 Dec 2019 14:33:11 +0100 Subject: [PATCH] Correct the behavior for creating new events Do a pushState, if it is a new event and we are really in editing new, rather a replaceState --- .gitignore | 2 ++ public/javascripts/pcal_pentry_edit_manager.js | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 144585f..17a018f 100644 --- a/.gitignore +++ b/.gitignore @@ -76,3 +76,5 @@ typings/ # FuseBox cache .fusebox/ +# sessions +sessions/ diff --git a/public/javascripts/pcal_pentry_edit_manager.js b/public/javascripts/pcal_pentry_edit_manager.js index e6fd29a..e5a2513 100644 --- a/public/javascripts/pcal_pentry_edit_manager.js +++ b/public/javascripts/pcal_pentry_edit_manager.js @@ -132,7 +132,10 @@ var pcalPentryEditManager = function(websocket) { if(history.state.direction === 'day_show_event' || history.state.direction === 'pentry_edit_main') parent_event_uuid = history.state.event_uuid; console.log('parent_uuid', parent_event_uuid); - history.replaceState({direction: 'pentry_edit_main', pentrytype: _pentrytype, uuid: _uuid, event_uuid: parent_event_uuid, date: _date.date}, document.title, location.pathname); + if(_pentrytype === "event" && uuid === "new" && history.state.direction.substr(0,12) !== 'pentry_edit_') + history.pushState({direction: 'pentry_edit_main', pentrytype: _pentrytype, uuid: _uuid, event_uuid: parent_event_uuid, date: _date.date}, document.title, location.pathname); + else + history.replaceState({direction: 'pentry_edit_main', pentrytype: _pentrytype, uuid: _uuid, event_uuid: parent_event_uuid, date: _date.date}, document.title, location.pathname); } else { if(history.state.direction.substr(0,12) === 'pentry_edit_')