// Changing Typo preserving backward compatibility

This commit is contained in:
Jerome Nadaud
2013-11-25 11:02:40 +01:00
parent f588a2c0c3
commit d1c9ec8e09
5 changed files with 29 additions and 7 deletions
+12 -2
View File
@@ -123,7 +123,7 @@ $(document).ready(function()
hideFilterValueAction(this); hideFilterValueAction(this);
}); });
// To be sure there is no other events attached to the selectPrductSort, change the ID // To be sure there is no other events attached to the selectProductSort, change the ID
var id = 1; var id = 1;
while ($('#selectPrductSort').length) { // Because ids are duplicated while ($('#selectPrductSort').length) { // Because ids are duplicated
// Unbind event change on #selectPrductSort // Unbind event change on #selectPrductSort
@@ -134,8 +134,18 @@ $(document).ready(function()
$('label[for=selectPrductSort]').attr('for', 'selectPrductSort'+id); $('label[for=selectPrductSort]').attr('for', 'selectPrductSort'+id);
id++; id++;
} }
while ($('#selectProductSort').length) { // Because ids are duplicated
// Unbind event change on #selectProductSort
$('#selectProductSort').unbind('change');
$('#selectProductSort').attr('onchange', '');
$('#selectProductSort').addClass('selectProductSort');
$('#selectProductSort').attr('id', 'selectProductSort'+id);
$('label[for=selectProductSort]').attr('for', 'selectProductSort'+id);
id++;
}
// Since 1.5, event is add to .selectProductSort and not to #selectPrductSort // Since 1.5, event is add to .selectProductSort and not to #selectProductSort
setTimeout(function() { setTimeout(function() {
$('.selectProductSort').unbind('change'); $('.selectProductSort').unbind('change');
}, 100); }, 100);
@@ -1073,6 +1073,8 @@ $(window).load(function () {
$("select.form-control,input[type='checkbox']:not(.comparator), input[type='radio'],input#id_carrier2, input[type='file']").uniform(); $("select.form-control,input[type='checkbox']:not(.comparator), input[type='radio'],input#id_carrier2, input[type='file']").uniform();
$("#uniform-selectPrductSort1").innerWidth(0); $("#uniform-selectPrductSort1").innerWidth(0);
$("#uniform-selectPrductSort1 span").innerWidth(0); $("#uniform-selectPrductSort1 span").innerWidth(0);
$("#uniform-selectProductSort1").innerWidth(0);
$("#uniform-selectProductSort1 span").innerWidth(0);
}); });
@@ -123,7 +123,7 @@ $(document).ready(function()
hideFilterValueAction(this); hideFilterValueAction(this);
}); });
// To be sure there is no other events attached to the selectPrductSort, change the ID // To be sure there is no other events attached to the selectProductSort, change the ID
var id = 1; var id = 1;
while ($('#selectPrductSort').length) { // Because ids are duplicated while ($('#selectPrductSort').length) { // Because ids are duplicated
// Unbind event change on #selectPrductSort // Unbind event change on #selectPrductSort
@@ -134,6 +134,16 @@ $(document).ready(function()
$('label[for=selectPrductSort]').attr('for', 'selectPrductSort'+id); $('label[for=selectPrductSort]').attr('for', 'selectPrductSort'+id);
id++; id++;
} }
while ($('#selectProductSort').length) { // Because ids are duplicated
// Unbind event change on #selectProductSort
$('#selectProductSort').unbind('change');
$('#selectProductSort').attr('onchange', '');
$('#selectProductSort').addClass('selectProductSort');
$('#selectProductSort').attr('id', 'selectProductSort'+id);
$('label[for=selectProductSort]').attr('for', 'selectProductSort'+id);
id++;
}
// Since 1.5, event is add to .selectProductSort and not to #selectPrductSort // Since 1.5, event is add to .selectProductSort and not to #selectPrductSort
setTimeout(function() { setTimeout(function() {
@@ -40,7 +40,7 @@
//<![CDATA[ //<![CDATA[
$(document).ready(function() $(document).ready(function()
{ {
$('.selectPrductSort').change(function() $('.selectProductSort').change(function()
{ {
var requestSortProducts = '{$request}'; var requestSortProducts = '{$request}';
var splitData = $(this).val().split(':'); var splitData = $(this).val().split(':');
@@ -53,7 +53,7 @@
<div class="{$container_class}"> <div class="{$container_class}">
<form id="productsSortForm" action="{$request|escape:'html':'UTF-8'}"> <form id="productsSortForm" action="{$request|escape:'html':'UTF-8'}">
<select class="selectPrductSort"> <select class="selectProductSort">
<option value="{$orderbydefault|escape:'html':'UTF-8'}:{$orderwaydefault|escape:'html':'UTF-8'}" {if $orderby eq $orderbydefault}selected="selected"{/if}>{l s='Sort by'}</option> <option value="{$orderbydefault|escape:'html':'UTF-8'}:{$orderwaydefault|escape:'html':'UTF-8'}" {if $orderby eq $orderbydefault}selected="selected"{/if}>{l s='Sort by'}</option>
{if !$PS_CATALOG_MODE} {if !$PS_CATALOG_MODE}
<option value="price:asc" {if $orderby eq 'price' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='Price: Lowest first'}</option> <option value="price:asc" {if $orderby eq 'price' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='Price: Lowest first'}</option>
+2 -2
View File
@@ -60,8 +60,8 @@ $(document).ready(function(){
{/if} {/if}
<form id="productsSortForm{if isset($paginationId)}_{$paginationId}{/if}" action="{$request|escape:'html':'UTF-8'}" class="productsSortForm"> <form id="productsSortForm{if isset($paginationId)}_{$paginationId}{/if}" action="{$request|escape:'html':'UTF-8'}" class="productsSortForm">
<div class="select selector1"> <div class="select selector1">
<label for="selectPrductSort{if isset($paginationId)}_{$paginationId}{/if}">{l s='Sort by'}</label> <label for="selectProductSort{if isset($paginationId)}_{$paginationId}{/if}">{l s='Sort by'}</label>
<select id="selectPrductSort{if isset($paginationId)}_{$paginationId}{/if}" class="selectProductSort form-control"> <select id="selectProductSort{if isset($paginationId)}_{$paginationId}{/if}" class="selectProductSort form-control">
<option value="{$orderbydefault|escape:'html':'UTF-8'}:{$orderwaydefault|escape:'html':'UTF-8'}" {if $orderby eq $orderbydefault}selected="selected"{/if}>{l s='--'}</option> <option value="{$orderbydefault|escape:'html':'UTF-8'}:{$orderwaydefault|escape:'html':'UTF-8'}" {if $orderby eq $orderbydefault}selected="selected"{/if}>{l s='--'}</option>
{if !$PS_CATALOG_MODE} {if !$PS_CATALOG_MODE}
<option value="price:asc" {if $orderby eq 'price' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='Price: Lowest first'}</option> <option value="price:asc" {if $orderby eq 'price' AND $orderway eq 'asc'}selected="selected"{/if}>{l s='Price: Lowest first'}</option>