* Finish task#8156: Optimize the structure of the code.
This commit is contained in:
@@ -239,29 +239,6 @@ $(function()
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
/* Assign value to the manage products by the different request type.*/
|
||||
if(window.config.currentMethod === 'create')
|
||||
{
|
||||
var url = window.location.href;
|
||||
if(window.config.requestType === 'GET')
|
||||
{
|
||||
var paramStr = url.split('?')[1];
|
||||
var paramArr = paramStr.split('&');
|
||||
var productID = paramArr[2] ? paramArr[2].split('=')[1] : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
var urlArr = url.split('/');
|
||||
var paramStr = urlArr[urlArr.length-1];
|
||||
var paramArr = paramStr.split('-');
|
||||
var productID = paramArr[2] ? paramArr[2].split('.')[0] : 0;
|
||||
}
|
||||
var product = $('#products0');
|
||||
$(product).val(productID);
|
||||
$(product).trigger("chosen:updated");
|
||||
loadBranches($(product));
|
||||
}
|
||||
|
||||
adjustProductBoxMargin();
|
||||
adjustPlanBoxMargin();
|
||||
});
|
||||
|
||||
@@ -30,6 +30,12 @@ $(function()
|
||||
});
|
||||
}
|
||||
|
||||
/* Assign value to the manage products by the different request type.*/
|
||||
var product = $('#products0');
|
||||
$(product).val(productID);
|
||||
$(product).trigger("chosen:updated");
|
||||
loadBranches($(product));
|
||||
|
||||
var adjustMainCol = function()
|
||||
{
|
||||
$('.main-form .col-main').css('width', Math.max(250, Math.floor(($('#productsBox').outerWidth() - 50)/3) + 10));
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<?php js::set('weekend', $config->project->weekend);?>
|
||||
<?php js::set('holders', $lang->project->placeholder);?>
|
||||
<?php js::set('errorSameProducts', $lang->project->errorSameProducts);?>
|
||||
<?php js::set('productID', empty($productID) ? 0 : $productID);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
|
||||
Reference in New Issue
Block a user