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
Tatuya Kamada
erp5
Commits
dbae3b09
Commit
dbae3b09
authored
Jul 21, 2017
by
Tomáš Peterka
Committed by
Romain Courteaud
Jul 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui] Use clojures instead of arrow functions because they are not fully supported
parent
4c403ec8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
28 deletions
+28
-28
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
...emplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
+26
-26
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
View file @
dbae3b09
...
@@ -118,6 +118,13 @@
...
@@ -118,6 +118,13 @@
));
));
}
}
/** Clojure to ease finding in lists of lists by the first item **/
function
hasSameFirstItem
(
a
)
{
return
function
(
b
)
{
return
a
[
0
]
===
b
[
0
];
};
}
rJS
(
window
)
rJS
(
window
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// ready
// ready
...
@@ -268,7 +275,6 @@
...
@@ -268,7 +275,6 @@
.
onStateChange
(
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
,
var
gadget
=
this
,
sort_key
=
gadget
.
state
.
key
+
"
_sort_list:json
"
,
sort_key
=
gadget
.
state
.
key
+
"
_sort_list:json
"
,
class_value
,
sort_list
,
sort_list
,
column_list
,
column_list
,
sort_column_list
,
sort_column_list
,
...
@@ -327,12 +333,8 @@
...
@@ -327,12 +333,8 @@
// construct array of links for sortable columns, undefined otherwise
// construct array of links for sortable columns, undefined otherwise
return
RSVP
.
all
(
column_list
.
map
(
function
(
column
)
{
return
RSVP
.
all
(
column_list
.
map
(
function
(
column
)
{
function
is_current_column
(
item
)
{
var
is_sortable
=
sort_column_list
.
find
(
hasSameFirstItem
(
column
))
!==
undefined
,
return
item
[
0
]
===
column
[
0
];
current_sort
=
sort_list
.
find
(
hasSameFirstItem
(
column
)),
}
var
is_sortable
=
sort_column_list
.
find
(
is_current_column
)
!==
undefined
,
current_sort
=
sort_list
.
find
(
is_current_column
),
options
=
{};
options
=
{};
if
(
is_sortable
)
{
if
(
is_sortable
)
{
...
@@ -350,11 +352,9 @@
...
@@ -350,11 +352,9 @@
// so we can construct array of header objects to be rendered in the header template
// so we can construct array of header objects to be rendered in the header template
var
hide_button_text
,
var
hide_button_text
,
hide_button_name
,
hide_button_name
,
current_sort
,
head_value_list
=
column_list
.
map
(
function
(
column
,
index
)
{
head_value_list
=
[];
var
current_sort
=
sort_list
.
find
(
hasSameFirstItem
(
column
)),
for
(
i
=
0
;
i
<
column_list
.
length
;
i
+=
1
)
{
class_value
=
""
;
current_sort
=
sort_list
.
find
((
item
)
=>
item
[
0
]
===
column_list
[
i
][
0
]);
class_value
=
undefined
;
if
(
current_sort
!==
undefined
)
{
if
(
current_sort
!==
undefined
)
{
if
(
current_sort
[
1
]
===
'
ascending
'
)
{
if
(
current_sort
[
1
]
===
'
ascending
'
)
{
...
@@ -365,13 +365,13 @@
...
@@ -365,13 +365,13 @@
}
}
}
}
head_value_list
.
push
(
{
return
{
"
data-i18n
"
:
column_list
[
i
]
[
1
],
"
data-i18n
"
:
column
[
1
],
"
class_value
"
:
class_value
,
"
class_value
"
:
class_value
,
"
sort_link
"
:
column_sort_link_list
[
i
],
"
sort_link
"
:
column_sort_link_list
[
index
],
"
text
"
:
column_list
[
i
][
1
]
"
text
"
:
column
[
1
]
};
});
});
}
if
(
gadget
.
state
.
show_line_selector
)
{
if
(
gadget
.
state
.
show_line_selector
)
{
hide_button_text
=
'
Submit
'
;
hide_button_text
=
'
Submit
'
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
dbae3b09
...
@@ -236,7 +236,7 @@
...
@@ -236,7 +236,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
960.5
6198.53416.29457
</string>
</value>
<value>
<string>
960.5
7664.50157.3293
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -254,7 +254,7 @@
...
@@ -254,7 +254,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15006
26843.31
</float>
<float>
15006
56708.46
</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