// #PI-116 JS refactoring in BO
This commit is contained in:
@@ -92,7 +92,7 @@
|
||||
{* @todo : donot use 3 foreach, but assign var *}
|
||||
{foreach from=$accessories item=accessory}
|
||||
{$accessory.name|escape:'htmlall':'UTF-8'}{if !empty($accessory.reference)}{$accessory.reference}{/if}
|
||||
<span onclick="delAccessory({$accessory.id_product});" style="cursor: pointer;">
|
||||
<span class="delAccessory" name="{$accessory.id_product}" style="cursor: pointer;">
|
||||
<img src="../img/admin/delete.gif" class="middle" alt="" />
|
||||
</span><br />
|
||||
{/foreach}
|
||||
|
||||
@@ -83,11 +83,5 @@
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
displayFlags(languages, id_language, allowEmployeeFormLang);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -127,88 +127,4 @@
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
var default_is_ok = false;
|
||||
|
||||
var manageDefaultSupplier = function() {
|
||||
|
||||
var availables_radio_buttons = [];
|
||||
var radio_buttons = $('input[name="default_supplier"]');
|
||||
|
||||
for (i=0; i<radio_buttons.length; i++)
|
||||
{
|
||||
var item = $(radio_buttons[i]);
|
||||
|
||||
if (item.is(':disabled'))
|
||||
{
|
||||
if (item.is(':checked'))
|
||||
{
|
||||
item.attr("checked", "");
|
||||
default_is_ok = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
availables_radio_buttons.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
if (default_is_ok == false)
|
||||
{
|
||||
for (i=0; i<availables_radio_buttons.length; i++)
|
||||
{
|
||||
var item = $(availables_radio_buttons[i]);
|
||||
|
||||
if (item.is(':disabled') == false)
|
||||
{
|
||||
item.attr("checked", "checked");
|
||||
default_is_ok = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$('.supplierCheckBox').click(function() {
|
||||
|
||||
var check = $(this);
|
||||
|
||||
var checkbox = $('#default_supplier_'+check.val());
|
||||
|
||||
if (this.checked)
|
||||
{
|
||||
//enable default radio button associated
|
||||
checkbox.attr("disabled","");
|
||||
}
|
||||
else
|
||||
{
|
||||
//enable default radio button associated
|
||||
checkbox.attr("disabled","disabled");
|
||||
}
|
||||
|
||||
//manage default supplier check
|
||||
manageDefaultSupplier();
|
||||
|
||||
});
|
||||
|
||||
// @TODO: a better way to fix the accordion wrong size bug when the selected page is this page
|
||||
setTimeout(function() {
|
||||
$('#suppliers_accordion').accordion();
|
||||
// If one second was not enough to display page, another resize is needed
|
||||
setTimeout(function() {
|
||||
$('#suppliers_accordion').accordion('resize');
|
||||
}, 3000);
|
||||
}, 1000);
|
||||
|
||||
// Resize the accordion once the page is visible because of the bug with accordions initialized
|
||||
// inside a display:none block not having the correct size.
|
||||
$('#suppliers_accordion').parents('.product-tab-content').bind('displayed', function(){
|
||||
$('#suppliers_accordion').accordion("resize");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{/if}
|
||||
@@ -25,7 +25,6 @@
|
||||
*}
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var newLabel = '{l s='New label'}';
|
||||
var choose_language = '{l s='Choose language:'}';
|
||||
var required = '{l s='required'}';
|
||||
@@ -34,45 +33,7 @@
|
||||
var uploadableFileLabel = 0;
|
||||
var textFieldLabel = 0;
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".datepicker").datepicker({
|
||||
prevText: '',
|
||||
nextText: '',
|
||||
dateFormat: 'yy-mm-dd'
|
||||
});
|
||||
|
||||
if ($('#is_virtual_good').attr('checked'))
|
||||
{
|
||||
$('#virtual_good').show();
|
||||
$('#virtual_good_more').show();
|
||||
}
|
||||
|
||||
$('.is_virtual_good').hide();
|
||||
|
||||
if ( $('input[name=is_virtual_file]:checked').val() == 1)
|
||||
{
|
||||
$('#virtual_good_more').show();
|
||||
$('#is_virtual_file_product').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#virtual_good_more').hide();
|
||||
$('#is_virtual_file_product').hide();
|
||||
}
|
||||
|
||||
$('input[name=is_virtual_file]').live('change', function(e) {
|
||||
if($(this).val() == '1')
|
||||
{
|
||||
$('#virtual_good_more').show();
|
||||
$('#is_virtual_file_product').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#virtual_good_more').hide();
|
||||
$('#is_virtual_file_product').hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function uploadFile()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user