Commit 6599b706 authored by rlanvin's avatar rlanvin

Don't steal focus when the chatbox opens automatically

- Adding a new parameter "focus" to ChatBoxView.show
- Removing the parameter "callback" not used
parent 76ed0b7b
...@@ -2174,22 +2174,22 @@ ...@@ -2174,22 +2174,22 @@
return this; return this;
}, },
show: function (callback) { show: function (focus) {
if (this.$el.is(':visible') && this.$el.css('opacity') === "1") { if (this.$el.is(':visible') && this.$el.css('opacity') === "1") {
return this.focus(); return this.focus();
} }
this.initDragResize().setDimensions(); this.initDragResize().setDimensions();
this.$el.fadeIn(function () { this.$el.fadeIn(function () {
if (typeof callback === "function") {
callback.apply(this, arguments);
}
if (converse.connection.connected) { if (converse.connection.connected) {
// Without a connection, we haven't yet initialized // Without a connection, we haven't yet initialized
// localstorage // localstorage
this.model.save(); this.model.save();
} }
this.setChatState(ACTIVE); this.setChatState(ACTIVE);
this.scrollDown().focus(); this.scrollDown();
if ( focus ) {
this.focus();
}
}.bind(this)); }.bind(this));
return this; return this;
}, },
...@@ -3923,7 +3923,7 @@ ...@@ -3923,7 +3923,7 @@
if (chatbox.get('minimized')) { if (chatbox.get('minimized')) {
chatbox.maximize(); chatbox.maximize();
} else { } else {
chatbox.trigger('show'); chatbox.trigger('show', true);
} }
return chatbox; return chatbox;
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
- #261 show_controlbox_by_default config not working [diditopher] - #261 show_controlbox_by_default config not working [diditopher]
- #573 xgettext build error: `'javascript' unknown` - #573 xgettext build error: `'javascript' unknown`
- Save scroll position on minimize and restore it on maximize [rlanvin] - Save scroll position on minimize and restore it on maximize [rlanvin]
- #566 Do not steal the focus when the chatbox opens automatically [rlanvin]
## 0.10.1 (2016-02-06) ## 0.10.1 (2016-02-06)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment