// #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:
@@ -33,8 +33,6 @@
|
||||
var uploadableFileLabel = 0;
|
||||
var textFieldLabel = 0;
|
||||
|
||||
|
||||
|
||||
function uploadFile()
|
||||
{
|
||||
$.ajaxFileUpload (
|
||||
|
||||
@@ -86,39 +86,4 @@
|
||||
{/foreach}
|
||||
</div>
|
||||
<p> </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}
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user