// #PI-116 more JS refactoring in BO

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14512 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2012-04-05 16:29:45 +00:00
parent cb1a1df968
commit bb272a7e50
3 changed files with 37 additions and 37 deletions

View File

@@ -33,8 +33,6 @@
var uploadableFileLabel = 0;
var textFieldLabel = 0;
function uploadFile()
{
$.ajaxFileUpload (

View File

@@ -86,39 +86,4 @@
{/foreach}
</div>
<p>&nbsp;</p>
<script type="text/javascript">
$(document).ready(function() {
$('.check_all_warehouse').click(function() {
var check = $(this);
//get all checkboxes of current warehouse
var checkboxes = $('input[name*="'+check.val()+'"]');
for (i=0; i<checkboxes.length; i++)
{
var item = $(checkboxes[i]);
if (item.is(':checked'))
{
item.attr("checked", "");
}
else
{
item.attr("checked", "checked");
}
}
});
// @TODO: a better way to fix the accordion wrong size bug when the selected page is this page
setTimeout(function() {
$('#warehouse_accordion').accordion();
}, 500);
// 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.
$('#warehouse_accordion').parents('.product-tab-content').bind('displayed', function(){
$('#warehouse_accordion').accordion("resize");
});
});
</script>
{/if}

View File

@@ -1140,6 +1140,43 @@ product_tabs['VirtualProduct'] = new function(){
}
}
product_tabs['Warehouses'] = new function(){
var self = this;
this.onReady = function(){
$('.check_all_warehouse').click(function() {
var check = $(this);
//get all checkboxes of current warehouse
var checkboxes = $('input[name*="'+check.val()+'"]');
for (i=0; i<checkboxes.length; i++)
{
var item = $(checkboxes[i]);
if (item.is(':checked'))
{
item.attr("checked", "");
}
else
{
item.attr("checked", "checked");
}
}
});
// @TODO: a better way to fix the accordion wrong size bug when the selected page is this page
setTimeout(function() {
$('#warehouse_accordion').accordion();
}, 500);
// 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.
$('#warehouse_accordion').parents('.product-tab-content').bind('displayed', function(){
$('#warehouse_accordion').accordion("resize");
});
};
}
var tabs_manager = new ProductTabsManager();
tabs_manager.setTabs(product_tabs);