Merge pull request #514 from romainneutron/fix-1339

Fix #1339 : Fix admin file upload callback
This commit is contained in:
Romain Neutron
2013-07-17 04:08:47 -07:00
6 changed files with 39 additions and 41 deletions

View File

@@ -286,8 +286,28 @@ class Root implements ControllerProviderInterface
break;
}
if (isset($status[$bit])) {
$status = $status[$bit];
} else {
$status = array(
"labeloff" => '',
"labelon" => '',
"img_off" => '',
"img_on" => '',
"path_off" => '',
"path_on" => '',
"searchable" => false,
"printable" => false,
);
foreach ($app['locales.I18n.available'] as $code => $language) {
$status['labels_on'][$code] = null;
$status['labels_off'][$code] = null;
}
}
return $app['twig']->render('admin/statusbit/edit.html.twig', array(
'status' => isset($status[$bit]) ? $status[$bit] : array(),
'status' => $status,
'errorMsg' => $errorMsg
));
})->assert('databox_id', '\d+')

View File

@@ -323,12 +323,7 @@
$('#right-ajax').empty().addClass('loading');
},
done: function (e, data) {
$('#right-ajax').removeClass('loading').html(data.result);
enableForms($('#right-ajax form:not(.no-ajax)'));
$.each($('#right-ajax a'),function(i, el){
enableLink($(el));
});
enableFormsCallback(data.result);
}
});
});

View File

@@ -385,12 +385,7 @@
$('#right-ajax').empty().addClass('loading');
},
done: function (e, data) {
$('#right-ajax').removeClass('loading').html(data.result);
enableForms($('#right-ajax form:not(.no-ajax)'));
$.each($('#right-ajax a'),function(i, el){
enableLink($(el));
});
enableFormsCallback(data.result);
}
});
});

View File

@@ -78,21 +78,24 @@
type: method,
url: url,
data: datas,
success: function(datas){
$('#right-ajax').removeClass('loading').html(datas);
enableForms($('#right-ajax form:not(.no-ajax)'));
$.each($('#right-ajax a'),function(i, el){
enableLink($(el));
});
return;
}
success: enableFormsCallback
});
return false;
}
});
}
function enableFormsCallback(datas)
{
$('#right-ajax').removeClass('loading').html(datas);
enableForms($('#right-ajax form:not(.no-ajax)'));
$.each($('#right-ajax a'),function(i, el){
enableLink($(el));
});
return;
}
function enableLink(link) {
$(link).bind('click',function(event){
@@ -103,11 +106,7 @@
$('#right-ajax').empty().addClass('loading').parent().show();
$.get(dest, function(data) {
$('#right-ajax').removeClass('loading').html(data);
enableForms($('#right-ajax form:not(.no-ajax)'));
$.each($('#right-ajax a:not(.no-ajax)'),function(i, el){
enableLink($(el));
});
enableFormsCallback(data);
});
return false;
}
@@ -129,12 +128,7 @@
$('#right-ajax').empty().addClass('loading').parent().show();
$.get(dest, function(data) {
$('#right-ajax').removeClass('loading').html(data);
enableForms($('#right-ajax form:not(.no-ajax)'));
$.each($('#right-ajax a'),function(i, el){
enableLink($(el));
});
enableFormsCallback(data);
});
$('#tree .selected').removeClass('selected');
$(this).parent().addClass('selected');

View File

@@ -192,8 +192,7 @@ $(document).ready(function(){
$('#right-ajax').empty().addClass('loading');
},
done: function (e, data) {
$('#right-ajax').removeClass('loading').html(data.result);
enableFormsCallback(data.result);
}
});

View File

@@ -62,12 +62,7 @@ $(function () {
$('#right-ajax').empty().addClass('loading');
},
done: function (e, data) {
$('#right-ajax').removeClass('loading').html(data.result);
enableForms($('#right-ajax form:not(.no-ajax)'));
$.each($('#right-ajax a'),function(i, el){
enableLink($(el));
});
enableFormsCallback(data.result);
}
});
});