Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Gambier
erp5
Commits
04639363
Commit
04639363
authored
May 03, 2018
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: allow to keep current page in history on redirect
parent
4a7c43e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_router_js.js
...TemplateItem/web_page_module/rjs_gadget_erp5_router_js.js
+8
-4
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_router_js.js
View file @
04639363
...
@@ -102,8 +102,12 @@
...
@@ -102,8 +102,12 @@
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
// Change URL functions
// Change URL functions
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
function
synchronousChangeState
(
hash
)
{
function
synchronousChangeState
(
hash
,
push_history
)
{
if
(
push_history
)
{
window
.
location
=
hash
;
}
else
{
window
.
location
.
replace
(
hash
);
window
.
location
.
replace
(
hash
);
}
// Prevent execution of all next asynchronous code
// Prevent execution of all next asynchronous code
throw
new
RSVP
.
CancellationError
(
'
Redirecting to
'
+
hash
);
throw
new
RSVP
.
CancellationError
(
'
Redirecting to
'
+
hash
);
}
}
...
@@ -970,14 +974,14 @@
...
@@ -970,14 +974,14 @@
return
hash
;
return
hash
;
})
})
.
declareMethod
(
'
redirect
'
,
function
(
options
)
{
.
declareMethod
(
'
redirect
'
,
function
(
options
,
push_history
)
{
this
.
props
.
form_content
=
options
.
form_content
;
this
.
props
.
form_content
=
options
.
form_content
;
// XXX Should we make it a second method parameter
// XXX Should we make it a second method parameter
this
.
props
.
keep_message
=
true
;
this
.
props
.
keep_message
=
true
;
delete
options
.
form_content
;
delete
options
.
form_content
;
return
this
.
getCommandUrlFor
(
options
)
return
this
.
getCommandUrlFor
(
options
)
.
push
(
function
(
hash
)
{
.
push
(
function
(
hash
)
{
return
synchronousChangeState
(
hash
);
return
synchronousChangeState
(
hash
,
push_history
);
});
});
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment