bebeboutik/modules/ant_support/ant_support.js

61 lines
1.7 KiB
JavaScript
Raw Normal View History

function questionItemEdition(linkId) {
document.location.href = current_location + "&updatequestion&id=" + linkId;
}
function questionItemDeletion(linkId) {
var ok = confirm(i18n_delete)
if(ok == true) {
document.location.href = current_location + "&id=" + linkId + "&deletequestion=1";
}
}
function updatePositionQuestion(id, way, position) {
if (way==0) {
way = -1;
} else {
way = 1;
}
diff = position + way;
if(diff != 0){
$.ajax({
url: url_ajax_admin_support,
type: "GET",
dataType:'json',
data: "id=" + id + "&position=" + diff +"&updatepositionQuestion",
success: function(response) {
if (!response.has_error){
$('#questionActive').html(response.html);
}
}
});
}
}
function updatePositionSection(id, way, position) {
if (way==0) {
way = -1;
} else {
way = 1;
}
diff = position + way;
if(diff != 0){
$.ajax({
url: url_ajax_admin_support,
type: "GET",
dataType:'json',
data: "id=" + id + "&position=" + diff +"&updatepositionSection",
success: function(response) {
if (!response.has_error){
$('#sectionActive').html(response.html);
}
}
});
}
}
function sectionItemEdition(linkId) {
document.location.href = current_location + "&updatesection&id=" + linkId;
}
function sectionItemDeletion(linkId) {
var ok = confirm(i18n_delete)
if(ok == true) {
document.location.href = current_location + "&id=" + linkId + "&deletesection=1";
}
}