FEATURE: focus input on modals is optional
This commit is contained in:
parent
71f211f0b3
commit
d4f3f894f4
|
@ -7,6 +7,7 @@
|
|||
@module Discourse
|
||||
**/
|
||||
Discourse.ModalBodyView = Discourse.View.extend({
|
||||
focusInput: true,
|
||||
|
||||
_setupModal: function() {
|
||||
var self = this,
|
||||
|
@ -20,7 +21,7 @@ Discourse.ModalBodyView = Discourse.View.extend({
|
|||
$('#modal-alert').hide();
|
||||
|
||||
// Focus on first element
|
||||
if (!Discourse.Mobile.mobileView) {
|
||||
if (!Discourse.Mobile.mobileView && self.get('focusInput')) {
|
||||
Em.run.schedule('afterRender', function() {
|
||||
self.$('input:first').focus();
|
||||
});
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
export default Discourse.ModalBodyView.extend({
|
||||
templateName: 'modal/search_help',
|
||||
title: I18n.t('search_help.title')
|
||||
title: I18n.t('search_help.title'),
|
||||
focusInput: false
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue