mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-13 12:49:04 +08:00
Keyboard shortcut for previous, next and refresh buttons
This commit is contained in:
@@ -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;
|
|||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<strong class="modal-title pull-left">Modal title</strong>
|
<strong class="modal-title pull-left">Modal title</strong>
|
||||||
|
|||||||
Reference in New Issue
Block a user