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
9eecb911
Commit
9eecb911
authored
Jul 31, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gadgets/Browser: fixed prev/next button assignments
parent
7e2ccb48
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
15 deletions
+27
-15
css/css.css
css/css.css
+3
-0
modules/core/storage/storage.js
modules/core/storage/storage.js
+2
-1
modules/ui/browser/browser.js
modules/ui/browser/browser.js
+21
-10
modules/ui/items/items.css
modules/ui/items/items.css
+0
-3
modules/ui/items/items.js
modules/ui/items/items.js
+1
-1
No files found.
css/css.css
View file @
9eecb911
/* global CSS */
.rebate
{
color
:
red
!important
;
}
@media
(
max-width
:
40em
)
{
/* convert button with text to icon-only */
/*
...
...
modules/core/storage/storage.js
View file @
9eecb911
...
...
@@ -659,7 +659,8 @@ define([
"
original_price
"
,
"
title
"
,
"
media
"
,
"
dimensions
"
"
dimensions
"
,
"
currency
"
];
query
.
limit
=
[];
...
...
modules/ui/browser/browser.js
View file @
9eecb911
...
...
@@ -8,20 +8,28 @@ define([
var
that
=
{};
// get previous and next id
// TODO: this only works with id-numbers!!!
// TODO: problem is also that no other field can be used to iterate
// unless we want to get allDocs(includeDocs)
// TODO: this should receive the total number of results of a query/search!
priv
.
getPrevNextItem
=
function
(
arr
,
id
,
next
,
max
)
{
var
step
=
next
?
1
:
-
1
,
i
,
id
;
for
(
i
=
0
;
i
<=
max
;
i
+=
1
)
{
if
(
i
===
parseFloat
(
id
))
{
var
step
=
next
?
1
:
-
1
,
position
,
id
;
for
(
position
=
1
;
position
<
max
;
position
+=
1
)
{
if
(
position
===
parseFloat
(
id
))
{
// we have found the position in the array, get prev/next
if
(
next
)
{
if
(
arr
[
i
+
1
]
===
undefined
)
{
if
(
arr
[
position
]
===
undefined
)
{
return
false
;
}
return
arr
[
i
+
1
].
id
;
}
if
(
arr
[
i
-
1
]
===
-
1
)
{
return
arr
[
position
].
id
;
}
else
{
// less 1 is self, less 2 is previous...
if
(
arr
[
position
-
2
]
===
undefined
)
{
return
false
;
}
return
arr
[
i
-
1
].
id
;
return
arr
[
position
-
2
].
id
;
}
}
}
};
...
...
@@ -63,19 +71,22 @@ define([
if
(
err
)
{
}
else
{
console
.
log
(
response
);
// set next
// TODO: this is bad, because we can only point to doc_id, no matter what
// identifier we are setting. item_id itself is... bad... fix!
next
=
priv
.
getPrevNextItem
(
response
.
rows
,
currentId
,
true
,
response
.
total_rows
);
if
(
!
next
)
{
markup
=
params
.
source
.
replace
(
"
translate next
"
,
"
translate next ui-state-disabled
"
);
}
else
{
markup
=
params
.
source
.
replace
(
identifier
+
"
=next
"
,
identifier
+
"
=
"
+
next
);
console
.
log
(
markup
)
}
// set previous
prev
=
priv
.
getPrevNextItem
(
response
.
rows
,
currentId
,
false
,
response
.
total_rows
);
if
(
!
prev
)
{
markup
=
params
.
source
.
replace
(
"
translate prev
"
,
"
translate prev ui-state-disabled
"
);
markup
=
markup
.
replace
(
"
translate prev
"
,
"
translate prev ui-state-disabled
"
);
}
else
{
markup
=
markup
.
replace
(
identifier
+
"
=prev
"
,
identifier
+
"
=
"
+
prev
);
}
...
...
modules/ui/items/items.css
View file @
9eecb911
...
...
@@ -128,9 +128,6 @@
font-size
:
.75em
;
font-weight
:
normal
;
}
.items_listview
.description_items
.rebate
{
color
:
red
!important
;
}
.items_show
{
clear
:
both
;
color
:
#111111
!important
;
...
...
modules/ui/items/items.js
View file @
9eecb911
...
...
@@ -61,7 +61,7 @@ define([
// generate results
for
(
i
=
0
;
i
<
response
.
total_rows
;
i
+=
1
)
{
item
=
response
.
rows
[
i
].
value
;
console
.
log
(
item
);
if
(
item
.
price
===
item
.
original_price
)
{
price
=
item
.
price
+
item
.
currency
;
}
else
{
...
...
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