Browse Source

Prendre en charge la touche "Esc" pour sortir du plein ecran même si on a pas mis le focus sur le champ d'edition (Franck)

3.1
cedric@yterium.com 9 years ago
parent
commit
30a8d13e0f
  1. 12
      javascript/jquery.previsu_spip.js

12
javascript/jquery.previsu_spip.js

@ -54,16 +54,20 @@
}
var timerPreview=null;
mark.addClass('livepreview').find('.markItUpEditor').bind('keyup click change focus refreshpreview',function(e){
if (is_full_screen){
if (timerPreview) clearTimeout(timerPreview);
timerPreview = setTimeout(refresh_preview,500);
}
});
$(window).bind('keyup',function(e){
if (is_full_screen){
// Touche Echap pour sortir du mode fullscreen
if (e.type == 'keyup' && e.keyCode==27){
if (e.type=='keyup' && e.keyCode==27){
mark.removeClass('fullscreen');
is_full_screen = false;
}
if (timerPreview) clearTimeout(timerPreview);
timerPreview = setTimeout(refresh_preview,500);
}
})
});
}
mark.find('.markItUpEditor').trigger('refreshpreview');
}

Loading…
Cancel
Save