mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
FIX: Should blur the field when closing the progress widget
This commit is contained in:
parent
a33c2fa165
commit
d7ee074837
2 changed files with 6 additions and 5 deletions
|
@ -7,7 +7,7 @@ export default Ember.Controller.extend({
|
||||||
toPostIndex: null,
|
toPostIndex: null,
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleExpansion: function(opts) {
|
toggleExpansion(opts) {
|
||||||
this.toggleProperty('expanded');
|
this.toggleProperty('expanded');
|
||||||
if (this.get('expanded')) {
|
if (this.get('expanded')) {
|
||||||
this.set('toPostIndex', this.get('progressPosition'));
|
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);
|
var postIndex = parseInt(this.get('toPostIndex'), 10);
|
||||||
|
|
||||||
// Validate the post index first
|
// Validate the post index first
|
||||||
|
@ -52,17 +52,17 @@ export default Ember.Controller.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
jumpTop: function() {
|
jumpTop() {
|
||||||
this.jumpTo(this.get('model.firstPostUrl'));
|
this.jumpTo(this.get('model.firstPostUrl'));
|
||||||
},
|
},
|
||||||
|
|
||||||
jumpBottom: function() {
|
jumpBottom() {
|
||||||
this.jumpTo(this.get('model.lastPostUrl'));
|
this.jumpTo(this.get('model.lastPostUrl'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Route and close the expansion
|
// Route and close the expansion
|
||||||
jumpTo: function(url) {
|
jumpTo(url) {
|
||||||
this.set('expanded', false);
|
this.set('expanded', false);
|
||||||
DiscourseURL.routeTo(url);
|
DiscourseURL.routeTo(url);
|
||||||
},
|
},
|
||||||
|
|
|
@ -98,6 +98,7 @@ export default Ember.View.extend({
|
||||||
const controller = this.get('controller');
|
const controller = this.get('controller');
|
||||||
if (controller.get('expanded')) {
|
if (controller.get('expanded')) {
|
||||||
if (e.keyCode === 13) {
|
if (e.keyCode === 13) {
|
||||||
|
this.$('input').blur();
|
||||||
controller.send('jumpPost');
|
controller.send('jumpPost');
|
||||||
} else if (e.keyCode === 27) {
|
} else if (e.keyCode === 27) {
|
||||||
controller.send('toggleExpansion');
|
controller.send('toggleExpansion');
|
||||||
|
|
Loading…
Reference in a new issue