From 0bf39ff7a47b2491af28096c19a1533e3770547e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 18 Dec 2011 15:33:47 +0100 Subject: [PATCH] Fix ajaxLoad onSubmit --- file/js/TimWolla.WCF.Chat.js | 11 +++++++---- template/chat.tpl | 22 ++++++++-------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/file/js/TimWolla.WCF.Chat.js b/file/js/TimWolla.WCF.Chat.js index 5881417..4e7299b 100644 --- a/file/js/TimWolla.WCF.Chat.js +++ b/file/js/TimWolla.WCF.Chat.js @@ -170,27 +170,30 @@ if (typeof TimWolla.WCF == 'undefined') TimWolla.WCF = {}; if (options.submit) $('#chatForm').submit(); else $('#chatInput').focus(); + }, + refreshRoomList: function() { + $('.chatRoom').unbind('click'); + + }, submit: function (target) { // break if input contains only whitespace if ($('#chatInput').val().trim().length === 0) return false; - submitButton = target.find('input[type=image]'); - $.ajax($('#chatForm').attr('action'), { data: { text: $('#chatInput').val() }, type: 'POST', beforeSend: $.proxy(function (jqXHR) { - submitButton.addClass('ajaxLoad'); + $('#chatInput').addClass('ajaxLoad'); }), success: $.proxy(function (data, textStatus, jqXHR) { this.getMessages(); $('#chatInput').val('').focus(); }, this), complete: function() { - submitButton.removeClass('ajaxLoad'); + $('#chatInput').removeClass('ajaxLoad'); } }); }, diff --git a/template/chat.tpl b/template/chat.tpl index e8d0580..6ee67d4 100644 --- a/template/chat.tpl +++ b/template/chat.tpl @@ -22,10 +22,6 @@ margin-bottom: -20px !important; } - #sidebar { - /*height: 450px;*/ - } - aside { overflow: auto; padding: 0 1px 0 0; @@ -73,10 +69,8 @@ } #chatInput { - background-position: right center; - background-repeat: no-repeat; position: relative; - z-index: 10; + z-index: 10; } #chatOptions { @@ -192,13 +186,13 @@ .textCounter { background: none repeat scroll 0 0 red; - margin-left: -5px; - padding: 5px; - position: relative; - z-index: 0 !important; - border-radius: 0px 5px 5px 0px; - background-color: rgba(0, 0, 0, 0.7); - border: 1px solid rgba(255, 255, 255, 0.3); + margin-left: -5px; + padding: 5px; + position: relative; + z-index: 0 !important; + border-radius: 0px 5px 5px 0px; + background-color: rgba(0, 0, 0, 0.7); + border: 1px solid rgba(255, 255, 255, 0.3); } .textCounter.color-1 {