ソースを参照

Make controlbox appear in a smoother fashion in webkit

when clicking the controlbox toggle
JC Brand 11 年 前
コミット
680548612c
1 ファイル変更15 行追加18 行削除
  1. 15 18
      converse.js

+ 15 - 18
converse.js

@@ -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 @@
             },
             },
 
 
             show: function () {
             show: function () {
-                converse.controlboxtoggle.hide();
-                if (this.$el.is(':visible') && this.$el.css('opacity') == "1") {
-                    return;
-                }
-                if (converse.animate) {
-                    this.$el.css({'opacity': 0, 'display': 'inline'}).animate({opacity: '1'}, 200, null, function () {
-                        converse.refresh();
-                    });
-                } else {
-                    this.$el.css({'opacity': 1, 'display': 'inline'}); converse.refresh();
-                }
-                if (converse.connection) {
-                    // Without a connection, we haven't yet initialized
-                    // localstorage
-                    this.model.save();
-                }
-                converse.emit('onControlBoxOpened', this);
+                converse.controlboxtoggle.hide($.proxy(function () {
+                    if (converse.animate) {
+                        this.$el.css({'opacity': 0, 'display': 'inline'}).animate({opacity: '1'}, 200, null, function () {
+                            converse.refresh();
+                        });
+                    } else {
+                        this.$el.css({'opacity': 1, 'display': 'inline'}); converse.refresh();
+                    }
+                    if (converse.connection) {
+                        // Without a connection, we haven't yet initialized
+                        // localstorage
+                        this.model.save();
+                    }
+                    converse.emit('onControlBoxOpened', this);
+                }, this));
                 return this;
                 return this;
             },
             },