72 lines
1.8 KiB
JavaScript
72 lines
1.8 KiB
JavaScript
|
|
function deliveryOn(){
|
||
|
|
$("#order_create_form_deliveryAddress-block").show();
|
||
|
|
$("#order_create_form_deliveryContactName-block").show();
|
||
|
|
$("#order_create_form_deliveryContactPhone-block").show();
|
||
|
|
}
|
||
|
|
function deliveryOff(){
|
||
|
|
$("#order_create_form_deliveryAddress-block").hide();
|
||
|
|
$("#order_create_form_deliveryContactName-block").hide();
|
||
|
|
$("#order_create_form_deliveryContactPhone-block").hide();
|
||
|
|
}
|
||
|
|
function analiceOn(){
|
||
|
|
$("#cost_analice_button").show();
|
||
|
|
}
|
||
|
|
function analiceOff(){
|
||
|
|
$("#cost_analice_button").hide();
|
||
|
|
}
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
if($("#order_create_form_deliveryRequired-edit").checked){
|
||
|
|
deliveryOn();
|
||
|
|
}
|
||
|
|
else {
|
||
|
|
deliveryOff();
|
||
|
|
}
|
||
|
|
|
||
|
|
if($("#order_create_form_objectType-edit").val() == 'FLAT'){
|
||
|
|
analiceOn();
|
||
|
|
}
|
||
|
|
else {
|
||
|
|
analiceOff();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
$("#order_create_form_deliveryRequired-edit").change(function() {
|
||
|
|
if(this.checked) {
|
||
|
|
deliveryOn();
|
||
|
|
}
|
||
|
|
else {
|
||
|
|
deliveryOff();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
$("#order_create_form_objectType-edit").change(function(){
|
||
|
|
if($(this).val() == 'FLAT'){
|
||
|
|
analiceOn();
|
||
|
|
}
|
||
|
|
else {
|
||
|
|
analiceOff();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
$(".fileuploader-action-remove").click(function(event){
|
||
|
|
var photoid = $(this).attr("data-photo-id");
|
||
|
|
var itemid = "#photo-item-" + photoid;
|
||
|
|
$(itemid).remove();
|
||
|
|
});
|
||
|
|
|
||
|
|
$("#order_create_form_submit-edit").click(function(event){
|
||
|
|
/*event.preventDefault();*/
|
||
|
|
var photolist = '';
|
||
|
|
$('.fileuploader-action-remove').each(function(){
|
||
|
|
var photoid = $(this).attr("data-photo-id");
|
||
|
|
photolist = photolist + photoid + ',';
|
||
|
|
});
|
||
|
|
$('#photolist').val(photolist);
|
||
|
|
});
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
|
||
|
|
|