From d7ee07483781adbd83bbf09b2c86c3cc94c4214a Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 9 Nov 2015 12:36:48 -0500 Subject: [PATCH] FIX: Should blur the field when closing the progress widget --- .../discourse/controllers/topic-progress.js.es6 | 10 +++++----- .../javascripts/discourse/views/topic-progress.js.es6 | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/topic-progress.js.es6 b/app/assets/javascripts/discourse/controllers/topic-progress.js.es6 index 39e9ff2b7..324d3b735 100644 --- a/app/assets/javascripts/discourse/controllers/topic-progress.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic-progress.js.es6 @@ -7,7 +7,7 @@ export default Ember.Controller.extend({ toPostIndex: null, actions: { - toggleExpansion: function(opts) { + toggleExpansion(opts) { this.toggleProperty('expanded'); if (this.get('expanded')) { this.set('toPostIndex', this.get('progressPosition')); @@ -20,7 +20,7 @@ export default Ember.Controller.extend({ } }, - jumpPost: function() { + jumpPost() { var postIndex = parseInt(this.get('toPostIndex'), 10); // Validate the post index first @@ -52,17 +52,17 @@ export default Ember.Controller.extend({ } }, - jumpTop: function() { + jumpTop() { this.jumpTo(this.get('model.firstPostUrl')); }, - jumpBottom: function() { + jumpBottom() { this.jumpTo(this.get('model.lastPostUrl')); } }, // Route and close the expansion - jumpTo: function(url) { + jumpTo(url) { this.set('expanded', false); DiscourseURL.routeTo(url); }, diff --git a/app/assets/javascripts/discourse/views/topic-progress.js.es6 b/app/assets/javascripts/discourse/views/topic-progress.js.es6 index 6bb2604ac..7fc204720 100644 --- a/app/assets/javascripts/discourse/views/topic-progress.js.es6 +++ b/app/assets/javascripts/discourse/views/topic-progress.js.es6 @@ -98,6 +98,7 @@ export default Ember.View.extend({ const controller = this.get('controller'); if (controller.get('expanded')) { if (e.keyCode === 13) { + this.$('input').blur(); controller.send('jumpPost'); } else if (e.keyCode === 27) { controller.send('toggleExpansion');