Commit 68054861 authored by JC Brand's avatar JC Brand

Make controlbox appear in a smoother fashion in webkit

when clicking the controlbox toggle
parent d0af9742
...@@ -1631,7 +1631,6 @@ ...@@ -1631,7 +1631,6 @@
hide: function (callback) { hide: function (callback) {
this.$el.hide('fast', function () { this.$el.hide('fast', function () {
converse.controlboxtoggle.show(function () { converse.controlboxtoggle.show(function () {
converse.refresh();
if (typeof callback === "function") { if (typeof callback === "function") {
callback(); callback();
} }
...@@ -1640,23 +1639,21 @@ ...@@ -1640,23 +1639,21 @@
}, },
show: function () { show: function () {
converse.controlboxtoggle.hide(); converse.controlboxtoggle.hide($.proxy(function () {
if (this.$el.is(':visible') && this.$el.css('opacity') == "1") { if (converse.animate) {
return; this.$el.css({'opacity': 0, 'display': 'inline'}).animate({opacity: '1'}, 200, null, function () {
} converse.refresh();
if (converse.animate) { });
this.$el.css({'opacity': 0, 'display': 'inline'}).animate({opacity: '1'}, 200, null, function () { } else {
converse.refresh(); this.$el.css({'opacity': 1, 'display': 'inline'}); converse.refresh();
}); }
} else { if (converse.connection) {
this.$el.css({'opacity': 1, 'display': 'inline'}); converse.refresh(); // Without a connection, we haven't yet initialized
} // localstorage
if (converse.connection) { this.model.save();
// Without a connection, we haven't yet initialized }
// localstorage converse.emit('onControlBoxOpened', this);
this.model.save(); }, this));
}
converse.emit('onControlBoxOpened', this);
return this; return this;
}, },
......
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