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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
cd0cdd2a
Commit
cd0cdd2a
authored
Sep 21, 2017
by
Tomáš Peterka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui] Header.render expects complete state thus resets all buttons every time
parent
ff7e889b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.js
...TemplateItem/web_page_module/rjs_gadget_erp5_header_js.js
+14
-11
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
...emplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.js
View file @
cd0cdd2a
...
...
@@ -62,6 +62,7 @@
];
gadget_klass
/* Init state is important because `render` is not necesarily called first*/
.
setState
({
loaded
:
false
,
modified
:
false
,
...
...
@@ -75,6 +76,7 @@
right_button
:
{},
right_link
:
{}
})
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
...
...
@@ -135,19 +137,25 @@
});
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
gadget
=
this
,
var
sub_header_list
=
[]
,
state
=
{
"
error
"
:
options
.
error
||
false
// render does not touch "loaded", "modified" or "submitted"
"
error
"
:
options
.
error
||
false
,
// set empty templates for all buttons to force-reset them because
// render expects complete state (complete definition of all buttons)
"
main_link
"
:
{},
"
right_link
"
:
{},
"
right_button
"
:
{},
"
left_button
"
:
{}
},
klass
,
sub_header_list
=
[],
i
;
// Main title
if
(
options
.
hasOwnProperty
(
"
page_title
"
)
||
options
.
hasOwnProperty
(
"
page_icon
"
))
{
state
.
main_link
=
{
"
title
"
:
options
.
page_title
||
gadget
.
state
.
main_link
.
title
,
"
icon
"
:
options
.
page_icon
||
gadget
.
state
.
main_link
.
icon
,
"
title
"
:
options
.
page_title
,
"
icon
"
:
options
.
page_icon
,
"
url
"
:
''
};
for
(
i
=
0
;
i
<
possible_main_link_list
.
length
;
i
+=
1
)
{
...
...
@@ -156,11 +164,6 @@
state
.
main_link
.
url
=
options
[
possible_main_link_list
[
i
][
0
]];
}
}
// if a new page title|icon is specified then we clear all menu buttons
// because the view changed completely
state
.
right_link
=
{};
state
.
right_button
=
{};
state
.
left_button
=
{};
}
// Left button
...
...
@@ -240,7 +243,7 @@
default_title_icon
=
"
spinner
"
;
}
// Updating globally the page title. Does not follow RenderJS philosophy, but, it is enough for now
document
.
title
=
gadget
.
state
.
main_link
.
title
;
document
.
title
=
gadget
.
state
.
main_link
.
title
||
""
;
// Update icon in case an action in process (keep the original in state.title_icon)
main_link
=
{
"
title
"
:
gadget
.
state
.
main_link
.
title
,
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
View file @
cd0cdd2a
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
962.1
014.20681.8021
</string>
</value>
<value>
<string>
962.1
5685.40055.49408
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
150
5297561.5
</float>
<float>
150
6002370.1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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