Commit 5b648c99 by Thiago Talma

Keyboard shortcut for previous, next and refresh buttons

parent 993963bb
...@@ -69,6 +69,16 @@ yii.gii = (function ($) { ...@@ -69,6 +69,16 @@ yii.gii = (function ($) {
}); });
return false; return false;
}); });
$('#preview-modal').on('keydown', function(e) {
if (e.keyCode === 37) {
$('.modal-previous').trigger('click');
} else if(e.keyCode === 39) {
$('.modal-next').trigger('click');
} else if(e.keyCode === 82) {
$('.modal-refresh').trigger('click');
}
});
}; };
var initConfirmationCheckboxes = function () { var initConfirmationCheckboxes = function () {
......
...@@ -82,9 +82,9 @@ use yii\gii\CodeFile; ...@@ -82,9 +82,9 @@ use yii\gii\CodeFile;
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<div class="btn-group pull-left"> <div class="btn-group pull-left">
<a class="modal-previous btn btn-xs btn-default" href="#"><span class="glyphicon glyphicon-arrow-left"></span></a> <a class="modal-previous btn btn-xs btn-default" href="#" title="Shortcut: Left Arrow Key"><span class="glyphicon glyphicon-arrow-left"></span></a>
<a class="modal-next btn btn-xs btn-default" href="#"><span class="glyphicon glyphicon-arrow-right"></span></a> <a class="modal-next btn btn-xs btn-default" href="#" title="Shortcut: Right Arrow Key"><span class="glyphicon glyphicon-arrow-right"></span></a>
<a class="modal-refresh btn btn-xs btn-default" href="#"><span class="glyphicon glyphicon-refresh"></span></a> <a class="modal-refresh btn btn-xs btn-default" href="#" title="Shortcut: R Key"><span class="glyphicon glyphicon-refresh"></span></a>
&nbsp; &nbsp;
</div> </div>
<strong class="modal-title pull-left">Modal title</strong> <strong class="modal-title pull-left">Modal title</strong>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment