瀏覽代碼

Bugfix. Set the connection attr on converse. Updates #41

JC Brand 12 年之前
父節點
當前提交
f96c52a09a
共有 1 個文件被更改,包括 3 次插入5 次删除
  1. 3 5
      converse.js

+ 3 - 5
converse.js

@@ -2517,13 +2517,11 @@
                 '<input type="text" id="bosh_service_url">'),
 
             connect: function ($form, jid, password) {
-                var button = null,
-                    connection = new Strophe.Connection(converse.bosh_service_url);
                 if ($form) {
-                    $button = $form.find('input[type=submit]');
-                    $button.hide().after('<span class="spinner login-submit"/>');
+                    $form.find('input[type=submit]').hide().after('<span class="spinner login-submit"/>');
                 }
-                connection.connect(jid, password, converse.onConnect);
+                converse.connection = new Strophe.Connection(converse.bosh_service_url);
+                converse.connection.connect(jid, password, converse.onConnect);
             },
 
             initialize: function (cfg) {