ajout du support de la touche entrée, issue #0000271
This commit is contained in:
parent
d063544a19
commit
4ea89f6770
@ -48,27 +48,16 @@ $(document).ready(function(){
|
||||
modal: true,
|
||||
open: function(event, ui) {
|
||||
$(this).html('Chargement...');
|
||||
$(this).load(href);
|
||||
$(this).load(href);
|
||||
$('#dialogsurv').keypress(function(e){
|
||||
if (e.keyCode == 13){
|
||||
e.preventDefault();
|
||||
survSubmit();
|
||||
}
|
||||
});
|
||||
},
|
||||
buttons: {
|
||||
'Ok': function() {
|
||||
var buttons = $('#dialogsurv').dialog('option','buttons');
|
||||
for( var button in buttons ){
|
||||
$(":button:contains('"+button+"')").attr('disabled','disabled');
|
||||
}
|
||||
var href = $(location).attr('href');
|
||||
var serData = $("#frmSurv").serialize();
|
||||
$("#frmSurv").replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
|
||||
$.post('./pages/ajax_surveillance.php', serData,
|
||||
function(data) {
|
||||
if(data==''){
|
||||
$('#frmSurv').html("L'entité a été placé sous surveillance.\n");
|
||||
$(location).attr('href', href);
|
||||
}else{
|
||||
$('#frmSurv').html(data);
|
||||
}
|
||||
});
|
||||
},
|
||||
Ok: function() { survSubmit(); },
|
||||
Annuler: function() { $(this).dialog('close'); }
|
||||
},
|
||||
close: function() { $('#dialogsurv').remove(); }
|
||||
@ -77,6 +66,26 @@ $(document).ready(function(){
|
||||
return false;
|
||||
});
|
||||
|
||||
function survSubmit(){
|
||||
var buttons = $('#dialogsurv').dialog('option','buttons');
|
||||
for( var button in buttons ){
|
||||
$(":button:contains('"+button+"')").attr('disabled','disabled');
|
||||
}
|
||||
var formAction = $('#frmSurv').attr('action');
|
||||
var href = $(location).attr('href');
|
||||
var serData = $('#frmSurv').serialize();
|
||||
$('#frmSurv').replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
|
||||
$.post(formAction, serData, function(data) {
|
||||
if(data==''){
|
||||
$('#frmSurv').html("L'entité a été placé sous surveillance.\n");
|
||||
$(location).attr('href', href);
|
||||
}else{
|
||||
$('#frmSurv').html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//Tooltip de surveillance
|
||||
$('u[tooltip]').each(function(){
|
||||
$(this).qtip({
|
||||
content: $(this).attr('tooltip'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user