Skip to content

Commit

Permalink
Merge pull request #91 from caciobanu/develop
Browse files Browse the repository at this point in the history
Fixed price slider
  • Loading branch information
caciobanu authored Oct 27, 2016
2 parents 3b60bf6 + 5491909 commit 1466f00
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 25 deletions.
29 changes: 17 additions & 12 deletions skin/frontend/base/default/js/catalin_seo/handler-ee-rwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var CatalinSeoHandler = {
if (val) {
var url = self.priceSlider.urlTemplate.replace('__PRICE_VALUE__', val);
if (self.isAjaxEnabled) {
self.handleEvent(url);
self.sendAjaxRequest(url);
} else {
window.location.href = url;
}
Expand All @@ -23,11 +23,11 @@ var CatalinSeoHandler = {
handleEvent: function (el, event) {
var url, fullUrl;
var self = this;
if (typeof el === 'string') {
url = el;
if (el.tagName.toLowerCase() === 'input') {
url = $(el).getAttribute('value');
} else if (el.tagName.toLowerCase() === 'a') {
url = $(el).readAttribute('href');
} else if (el.tagName.toLowerCase() === 'select' || el.tagName.toLowerCase() === 'input') {
} else if (el.tagName.toLowerCase() === 'select') {
url = $(el).getValue();
}

Expand All @@ -36,17 +36,22 @@ var CatalinSeoHandler = {
return;
}

self.sendAjaxRequest(url);

if (event) {
event.preventDefault();
}
},
sendAjaxRequest: function(url) {
var fullUrl;
var self = this;
fullUrl = self.prepareAjaxUrl(url);

$('loading').show();
$('ajax-errors').hide();

self.pushState(null, url, false);

self.showMoreListener();

self.searchBoxListener();

new Ajax.Request(fullUrl, {
method: 'get',
onSuccess: function (transport) {
Expand All @@ -61,6 +66,8 @@ var CatalinSeoHandler = {
self.toggleContent();
self.alignProductGridActions();
self.blockCollapsing();
self.showMoreListener();
self.searchBoxListener();

if (ConfigurableSwatchesList) {
setTimeout(function(){
Expand All @@ -74,10 +81,6 @@ var CatalinSeoHandler = {
},
onComplete: CatalinSeoHandler.sendUpdateEvent
});

if (event) {
event.preventDefault();
}
},
sendUpdateEvent: function() {
$j(document).trigger('catalin:updatePage');
Expand Down Expand Up @@ -209,6 +212,8 @@ var CatalinSeoHandler = {
self.toggleContent();
self.alignProductGridActions();
self.blockCollapsing();
self.showMoreListener();
self.searchBoxListener();

if (ConfigurableSwatchesList) {
setTimeout(function(){
Expand Down
31 changes: 18 additions & 13 deletions skin/frontend/base/default/js/catalin_seo/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ var CatalinSeoHandler = {
if (val) {
var url = self.priceSlider.urlTemplate.replace('__PRICE_VALUE__', val);
if (self.isAjaxEnabled) {
self.handleEvent(url);
self.sendAjaxRequest(url);
} else {
window.location.href = url;
}
}
},
handleEvent: function (el, event) {
var url, fullUrl;
var url;
var self = this;
if (typeof el === 'string') {
url = el;
if (el.tagName.toLowerCase() === 'input') {
url = $(el).getAttribute('value');
} else if (el.tagName.toLowerCase() === 'a') {
url = $(el).readAttribute('href');
} else if (el.tagName.toLowerCase() === 'select' || el.tagName.toLowerCase() === 'input') {
} else if (el.tagName.toLowerCase() === 'select') {
url = $(el).getValue();
}

Expand All @@ -35,6 +35,15 @@ var CatalinSeoHandler = {
return;
}

self.sendAjaxRequest(url);

if (event) {
event.preventDefault();
}
},
sendAjaxRequest: function(url) {
var fullUrl;
var self = this;
// Add this to query string for full page caching systems
if (url.indexOf('?') != -1) {
fullUrl = url + '&isLayerAjax=1';
Expand All @@ -47,10 +56,6 @@ var CatalinSeoHandler = {

self.pushState(null, url, false);

self.showMoreListener();

self.searchBoxListener();

new Ajax.Request(fullUrl, {
method: 'get',
onSuccess: function (transport) {
Expand All @@ -65,6 +70,8 @@ var CatalinSeoHandler = {
self.toggleContent();
self.alignProductGridActions();
self.blockCollapsing();
self.showMoreListener();
self.searchBoxListener();

if (ConfigurableSwatchesList) {
setTimeout(function(){
Expand All @@ -78,10 +85,6 @@ var CatalinSeoHandler = {
},
onComplete: CatalinSeoHandler.sendUpdateEvent
});

if (event) {
event.preventDefault();
}
},
sendUpdateEvent: function() {
$j(document).trigger('catalin:updatePage');
Expand Down Expand Up @@ -172,6 +175,8 @@ var CatalinSeoHandler = {
self.toggleContent();
self.alignProductGridActions();
self.blockCollapsing();
self.showMoreListener();
self.searchBoxListener();

if (ConfigurableSwatchesList) {
setTimeout(function(){
Expand Down

0 comments on commit 1466f00

Please sign in to comment.