FEATURE: focus input on modals is optional

This commit is contained in:
Sam 2014-10-21 08:12:29 +11:00
parent 71f211f0b3
commit d4f3f894f4
2 changed files with 4 additions and 2 deletions

View File

@ -7,6 +7,7 @@
@module Discourse @module Discourse
**/ **/
Discourse.ModalBodyView = Discourse.View.extend({ Discourse.ModalBodyView = Discourse.View.extend({
focusInput: true,
_setupModal: function() { _setupModal: function() {
var self = this, var self = this,
@ -20,7 +21,7 @@ Discourse.ModalBodyView = Discourse.View.extend({
$('#modal-alert').hide(); $('#modal-alert').hide();
// Focus on first element // Focus on first element
if (!Discourse.Mobile.mobileView) { if (!Discourse.Mobile.mobileView && self.get('focusInput')) {
Em.run.schedule('afterRender', function() { Em.run.schedule('afterRender', function() {
self.$('input:first').focus(); self.$('input:first').focus();
}); });

View File

@ -1,4 +1,5 @@
export default Discourse.ModalBodyView.extend({ export default Discourse.ModalBodyView.extend({
templateName: 'modal/search_help', templateName: 'modal/search_help',
title: I18n.t('search_help.title') title: I18n.t('search_help.title'),
focusInput: false
}); });