Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
0e604542
Commit
0e604542
authored
Jan 14, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: switching column sorting to new JSON API
parent
81a111fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
js/erp5_loader.js
js/erp5_loader.js
+7
-7
No files found.
js/erp5_loader.js
View file @
0e604542
...
...
@@ -416,6 +416,7 @@
**/
// TODO: integrate with app/app.sort, do we really need 2 methods
"
sort
"
:
function
(
obj
)
{
// 1 or 5 state sorting (none|asc_abc|desc_abc|asc_123|desc_123)
switch
(
obj
.
element
.
getAttribute
(
"
data-direction
"
))
{
case
"
desc_abc
"
:
...
...
@@ -436,7 +437,6 @@
app
.
sort
(
obj
,
undefined
,
"
sort-by-order
"
,
"
sort
"
);
break
;
default
:
// also handles single state sorting
app
.
sort
(
obj
,
"
desc_abc
"
,
"
sort
"
,
"
sort-by-alphabet-alt
"
);
break
;
}
...
...
@@ -3535,7 +3535,7 @@
link
=
undefined
;
attributes
=
{};
logic
=
{};
property
=
field
.
column
;
property
=
field
.
field
;
if
(
field
.
show
)
{
if
(
field
.
merge
===
undefined
)
{
...
...
@@ -3600,7 +3600,7 @@
"
data-action
"
:
field
.
href
?
null
:
"
sort
"
,
"
data-external
"
:
field
.
external
||
null
,
"
data-reference
"
:
field
.
href
?
null
:
spec
.
config
.
reference
,
"
data-column-title
"
:
field
.
href
?
null
:
field
.
column
,
"
data-column-title
"
:
field
.
href
?
null
:
field
.
field
,
"
text
"
:
title
||
null
,
"
img
"
:
field
.
image
?
(
typeof
field
.
image
===
"
string
"
?
{
"
href
"
:
field
.
image
,
"
alt
"
:
""
}
:
field
.
image
)
:
...
...
@@ -4617,11 +4617,13 @@
* @param {string} direction Direction to sort
* @param {string} prev Previous icon
* @param {string} next Next icon
* @param {boolean} single Single state sort
*/
// TODO: overwrite direction on single state sorting
app
.
sort
=
function
(
config
,
direction
,
prev
,
next
)
{
app
.
sort
=
function
(
config
,
direction
,
prev
,
next
,
single
)
{
var
i
,
in_array
,
sort_by
,
delay
;
// NOTE: if column title is not set, we might be sortling a list!
sort_by
=
config
.
element
.
getAttribute
(
"
data-column-title
"
);
if
(
sort_by
)
{
...
...
@@ -4634,8 +4636,6 @@
);
delay
=
500
;
}
else
{
// single state sorting
sort_by
=
config
.
id
.
split
(
"
_
"
)[
0
]
+
"
_
"
+
config
.
element
.
value
;
delay
=
0
;
}
...
...
@@ -5168,7 +5168,7 @@
if
(
l
>
0
)
{
info
+=
"
&
"
;
}
info
+=
options
.
sort_on
[
l
][
0
]
.
split
(
"
_
"
)[
1
]
;
info
+=
options
.
sort_on
[
l
][
0
];
}
}
break
;
...
...
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