diff --git a/forms/ecomerce/catalog/catalog.js b/forms/ecomerce/catalog/catalog.js
index 03db68a8..71c65d85 100644
--- a/forms/ecomerce/catalog/catalog.js
+++ b/forms/ecomerce/catalog/catalog.js
@@ -1,5 +1,7 @@
(function () {
-
+
+var maxFilters = 5;
+
var View = {
LIST: 0,
GRID: 1
@@ -82,7 +84,6 @@ Hedera.Catalog = new Class
icon: 'view-list',
tip: _('List view')
});
- this.view = View.GRID;
var className = 'grid-view';
}
else
@@ -91,10 +92,10 @@ Hedera.Catalog = new Class
icon: 'view-grid',
tip: _('Grid view')
});
- this.view = View.LIST;
var className = 'list-view';
}
+ this.view = view;
var node = this.$.gridView.node;
node.className = className;
localStorage.setItem ('hederaView', this.view);
@@ -102,8 +103,8 @@ Hedera.Catalog = new Class
,onSwitchViewClick: function ()
{
- this.setView (this.view === View.LIST ?
- View.GRID : View.LIST);
+ this.setView (this.view === View.GRID ?
+ View.LIST : View.GRID);
}
,onBasketReady: function (form)
@@ -139,8 +140,14 @@ Hedera.Catalog = new Class
this.$.items.query = this.buildQuery ('CALL catalogGetItems ()');
this.$.items.refresh ();
- var tagsQuery = this.buildQuery ('CALL catalogGetTags ()');
- this.conn.execQuery (tagsQuery, this.onTagsReady.bind (this));
+ var nTags = maxFilters - this.nFilters;
+
+ if (nTags > 0)
+ {
+ var tagsQuery = this.buildQuery (
+ 'CALL catalogGetTags (#nTags)', {nTags: nTags});
+ this.conn.execQuery (tagsQuery, this.onTagsReady.bind (this));
+ }
this.hideMenu ();
}
@@ -154,7 +161,6 @@ Hedera.Catalog = new Class
{
this.$.filters.style.display = show ? 'block' : 'none';
this.$.categoryMsg.style.display = show ? 'none' : 'block';
- this.$.order.style.display = show ? 'block' : 'none';
}
,onRemoveFiltersClick: function ()
@@ -164,6 +170,7 @@ Hedera.Catalog = new Class
}
,filters: {}
+ ,nFilters: 0
,buildQuery: function (query, params, excludeTag)
{
@@ -342,9 +349,11 @@ Hedera.Catalog = new Class
{
this.$.currentFilters.removeChild (filter);
delete this.filters[tagId];
+ this.nFilters--;
}
else if (this.filters[tagId] === undefined)
{
+ this.nFilters++;
this.filters[tagId] = filterData;
this.$.suggestedFilters.removeChild (filter);
this.$.currentFilters.appendChild (filter);
diff --git a/forms/ecomerce/catalog/style.css b/forms/ecomerce/catalog/style.css
index 05a89b3f..ce3e7465 100644
--- a/forms/ecomerce/catalog/style.css
+++ b/forms/ecomerce/catalog/style.css
@@ -48,33 +48,6 @@
white-space: nowrap;
overflow: hidden;
}
-.right-panel .filter
-{
- padding: 1em 1.8em;
-}
-.right-panel .filters,
-.right-panel .order
-{
- display: none;
-}
-.right-panel .category-msg
-{
- margin-top: 1em;
-}
-.right-panel .category-msg > h1
-{
- font-weight: normal;
- text-align: center;
- padding: 2.5em 0;
- color: #777;
-}
-.right-panel h2
-{
- font-weight: normal;
- padding: .4em 0;
- color: #777;
- font-size: 1.1em;
-}
.right-panel .categories
{
width: 95%;
@@ -93,13 +66,20 @@
padding: 0;
width: 100%;
}
-.right-panel .vn-filter,
-.right-panel select
+.right-panel .category-msg
{
- margin: 0 auto;
- margin-bottom: .7em;
- width: 90%;
- display: block;
+ margin-top: 1em;
+}
+.right-panel .category-msg > h1
+{
+ font-weight: normal;
+ text-align: center;
+ padding: 2.5em 0;
+ color: #777;
+}
+.right-panel .filters
+{
+ display: none;
}
.right-panel .filters > button
{
@@ -107,6 +87,13 @@
margin: 0 auto;
margin-top: 1em;
}
+.right-panel .filters label
+{
+ font-size: .9em;
+ color: #666;
+ padding-top: .7em;
+ display: block;
+}
/* Items */
diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml
index 9857eb3f..a19b0f85 100755
--- a/forms/ecomerce/catalog/ui.xml
+++ b/forms/ecomerce/catalog/ui.xml
@@ -65,10 +65,10 @@