diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2016-06-18 14:01:39 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2016-06-18 14:01:39 +0000 |
| commit | ef9544e477984efd73405c6847bd938a0a4ccfc8 (patch) | |
| tree | c46390944c88b5f1221c2d64663f91de18d67bc4 /views/mods/mod_productview/productview.js | |
| parent | 3bce1a992a438e64ae24d18d25f600b097d2210e (diff) | |
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5558 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods/mod_productview/productview.js')
| -rw-r--r-- | views/mods/mod_productview/productview.js | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/views/mods/mod_productview/productview.js b/views/mods/mod_productview/productview.js index 7a30c02..1f045c5 100644 --- a/views/mods/mod_productview/productview.js +++ b/views/mods/mod_productview/productview.js @@ -7,7 +7,19 @@ atts.page = page;
if (typeof order !== "undefined") atts.order = order;
- if (typeof mode !== "undefined") atts.mode = mode;
+ if (typeof mode !== "undefined") atts.mode = mode;
+ else
+ {
+
+ if (jQuery('#wpsg_productview_' + index + ' .wpsg_mod_productview_modeswitch > a').length > 0)
+ {
+
+ if (jQuery('#wpsg_productview_' + index + ' .wpsg_mod_productview_modeswitch > a.fa-th').hasClass('active')) atts.mode = 'grid';
+ else atts.mode = 'list';
+
+ }
+
+ }
if (jQuery('#wpsg_mod_productview_filter').length > 0)
{
@@ -40,8 +52,8 @@ function wpsg_correctProductview(index)
{
- var max_height = 0; jQuery('#wpsg_productview_' + index + ' .wpsg_mod_productview_name').each(function() { if (jQuery(this).outerHeight() > max_height) max_height = jQuery(this).outerHeight(); } ).outerHeight(max_height);
- var max_height = 0; jQuery('#wpsg_productview_' + index + ' .wpsg_mod_productview_description').each(function() { if (jQuery(this).outerHeight() > max_height) max_height = jQuery(this).outerHeight(); } ).outerHeight(max_height);
+ var max_height = 0; jQuery('#wpsg_productview_' + index + ' .wpsg_productview_product_grid .wpsg_mod_productview_name').each(function() { if (jQuery(this).outerHeight() > max_height) max_height = jQuery(this).outerHeight(); } ).outerHeight(max_height);
+ var max_height = 0; jQuery('#wpsg_productview_' + index + ' .wpsg_productview_product_grid .wpsg_mod_productview_description').each(function() { if (jQuery(this).outerHeight() > max_height) max_height = jQuery(this).outerHeight(); } ).outerHeight(max_height);
// Sortierungslayer
jQuery('.wpsg_mod_productview-order').bind('click', function(event) {
@@ -74,7 +86,32 @@ return false;
} ).disableSelection();
-
+
+ // Umschalten der List/Grid Ansichten
+ jQuery('.wpsg_mod_productview_modeswitch > a').bind('click', function() {
+
+ if (jQuery(this).hasClass('fa-th') &&!jQuery(this).hasClass('active'))
+ {
+
+ jQuery('.wpsg_productview_product_list').hide(250);
+ jQuery('.wpsg_productview_product_grid').show(250);
+
+ }
+ else if (jQuery(this).hasClass('fa-list') && !jQuery(this).hasClass('active'))
+ {
+
+ jQuery('.wpsg_productview_product_grid').hide(250);
+ jQuery('.wpsg_productview_product_list').show(250);
+
+ }
+
+ jQuery('.wpsg_mod_productview_modeswitch a').removeClass('active');
+ jQuery(this).addClass('active');
+
+ return false;
+
+ } );
+
}
function wpsg_filter_insert(values, set)
@@ -144,6 +181,6 @@ jQuery('.wpsg_mod_productview-order-layer:visible').each(function() { jQuery(this).parent().click(); } );
} );
-
+
} );
\ No newline at end of file |
