diff --git a/app/assets/javascripts/admin/views/site_setting_view.js b/app/assets/javascripts/admin/views/site_setting_view.js index b288d36c96d..37b724a65fb 100644 --- a/app/assets/javascripts/admin/views/site_setting_view.js +++ b/app/assets/javascripts/admin/views/site_setting_view.js @@ -22,6 +22,21 @@ Discourse.SiteSettingView = Discourse.View.extend(Discourse.ScrollTop, { // Default to string editor return 'admin/templates/site_settings/setting_string'; - }.property('content.type') + }.property('content.type'), + + didInsertElement: function() { + var self = this; + this._super(); + Em.run.schedule('afterRender', function() { + self.$('.input-setting-string').keydown(function(e) { + if (e.keyCode === 13) { // enter key + var setting = self.get('content'); + if (setting.get('dirty')) { + setting.save(); + } + } + }); + }); + } });