Set focus on first visible input when modal is shown
issue6684 review35531002
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Set focus on first visible input when modal is shown
|
||||
* Improve treeview headers
|
||||
* Add keyboard shortcuts
|
||||
* Update states of both toolbar and menu
|
||||
|
||||
@@ -516,6 +516,14 @@ var Sao = {};
|
||||
this.footer = jQuery('<div/>', {
|
||||
'class': 'modal-footer'
|
||||
}).appendTo(this.content);
|
||||
|
||||
this.modal.on('shown.bs.modal', function() {
|
||||
var currently_focused = jQuery(document.activeElement);
|
||||
var has_focus = currently_focused.closest(this.el) > 0;
|
||||
if (!has_focus) {
|
||||
jQuery(this).find(':input:visible:first').focus();
|
||||
}
|
||||
});
|
||||
},
|
||||
add_title: function(title) {
|
||||
this.header.append(jQuery('<h4/>', {
|
||||
|
||||
Reference in New Issue
Block a user