// fix #PSTEST-125
This commit is contained in:
+9
-9
@@ -929,14 +929,8 @@ function refreshImagePositions(imageTable)
|
||||
var reg = /_[0-9]$/g;
|
||||
var up_reg = new RegExp("imgPosition=[0-9]+&");
|
||||
|
||||
imageTable.find("tbody tr").each(function(i) {
|
||||
// Update link position
|
||||
// Up links
|
||||
$(this).find("td.dragHandle a:first").attr("href", $(this).find("td.dragHandle a:first").attr("href").replace(up_reg, "imgPosition="+ i +"&"));//, "imgPosition="+ (i - 1) +"&"));
|
||||
// Down links
|
||||
$(this).find("td.dragHandle a:last").attr("href", $(this).find("td.dragHandle a:last").attr("href").replace(up_reg, "imgPosition="+ (i + 2) +"&"));
|
||||
// Position image cell
|
||||
$(this).find("td.positionImage").html(i + 1);
|
||||
imageTable.find("tbody tr").each(function(i,el) {
|
||||
$(el).find("td.positionImage").html(i + 1);
|
||||
});
|
||||
imageTable.find("tr td.dragHandle a:hidden").show();
|
||||
imageTable.find("tr td.dragHandle:first a:first").hide();
|
||||
@@ -944,13 +938,16 @@ function refreshImagePositions(imageTable)
|
||||
}
|
||||
|
||||
|
||||
function doAdminAjax(data)
|
||||
function doAdminAjax(data, success_func, error_func)
|
||||
{
|
||||
$.ajax(
|
||||
{
|
||||
url : 'index.php',
|
||||
data : data,
|
||||
success : function(data){
|
||||
if (success_func)
|
||||
return success_func(data);
|
||||
|
||||
data = $.parseJSON(data);
|
||||
if(data.confirmations.length != 0)
|
||||
showSuccessMessage(data.confirmations);
|
||||
@@ -958,6 +955,9 @@ function doAdminAjax(data)
|
||||
showErrorMessage(data.error);
|
||||
},
|
||||
error : function(data){
|
||||
if (error_func)
|
||||
return error_func(data);
|
||||
|
||||
alert("[TECHNICAL ERROR]");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user