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
Klaus Wölfel
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 @@
...
@@ -62,6 +62,7 @@
];
];
gadget_klass
gadget_klass
/* Init state is important because `render` is not necesarily called first*/
.
setState
({
.
setState
({
loaded
:
false
,
loaded
:
false
,
modified
:
false
,
modified
:
false
,
...
@@ -75,6 +76,7 @@
...
@@ -75,6 +76,7 @@
right_button
:
{},
right_button
:
{},
right_link
:
{}
right_link
:
{}
})
})
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// ready
// ready
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
@@ -135,19 +137,25 @@
...
@@ -135,19 +137,25 @@
});
});
})
})
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
gadget
=
this
,
var
sub_header_list
=
[]
,
state
=
{
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
,
klass
,
sub_header_list
=
[],
i
;
i
;
// Main title
// Main title
if
(
options
.
hasOwnProperty
(
"
page_title
"
)
||
options
.
hasOwnProperty
(
"
page_icon
"
))
{
if
(
options
.
hasOwnProperty
(
"
page_title
"
)
||
options
.
hasOwnProperty
(
"
page_icon
"
))
{
state
.
main_link
=
{
state
.
main_link
=
{
"
title
"
:
options
.
page_title
||
gadget
.
state
.
main_link
.
title
,
"
title
"
:
options
.
page_title
,
"
icon
"
:
options
.
page_icon
||
gadget
.
state
.
main_link
.
icon
,
"
icon
"
:
options
.
page_icon
,
"
url
"
:
''
"
url
"
:
''
};
};
for
(
i
=
0
;
i
<
possible_main_link_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
possible_main_link_list
.
length
;
i
+=
1
)
{
...
@@ -156,11 +164,6 @@
...
@@ -156,11 +164,6 @@
state
.
main_link
.
url
=
options
[
possible_main_link_list
[
i
][
0
]];
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
// Left button
...
@@ -240,7 +243,7 @@
...
@@ -240,7 +243,7 @@
default_title_icon
=
"
spinner
"
;
default_title_icon
=
"
spinner
"
;
}
}
// Updating globally the page title. Does not follow RenderJS philosophy, but, it is enough for now
// 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)
// Update icon in case an action in process (keep the original in state.title_icon)
main_link
=
{
main_link
=
{
"
title
"
:
gadget
.
state
.
main_link
.
title
,
"
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 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
150
5297561.5
</float>
<float>
150
6002370.1
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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