From b75a53d6a59a57a0e535c2a3666386aa6a060bb8 Mon Sep 17 00:00:00 2001 From: franzz Date: Sun, 15 Jun 2014 21:06:54 +0200 Subject: [PATCH] fixing chat news layout if no news --- inc/databap.php | 1 + masks/chat.html | 28 ++++++++++++++++------------ style/screen.css | 3 --- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/inc/databap.php b/inc/databap.php index 8baebd0..0a05b61 100644 --- a/inc/databap.php +++ b/inc/databap.php @@ -1834,6 +1834,7 @@ class Databap extends PhpObject $asInfo['limit'] = 3; $asNews = $this->oMySql->selectRows($asInfo); + $asFormatNews = array(); foreach($asNews as $asNew) { $iMsgId = '-'.$asNew[$sMsgIdCol]; diff --git a/masks/chat.html b/masks/chat.html index 75e67ec..6b730a3 100755 --- a/masks/chat.html +++ b/masks/chat.html @@ -187,19 +187,23 @@ function getNews() 'news', function(asNews) { - $.each(asNews.news, function(ikey, asNew) + if(Object.keys(asNews.news).length>0) { - $('
', {'class':'new'}).hide() - .append($('

') - .append($('', {'class':'fa fa-inline fa-30 fa-c-news'})) - .append($('').text(asNew.message))) - .append($('

', {'class':'signature'}) - .text('—'+asNew.nickname) - .append('
') - .append($('', {'class':'news_time'}).text(asNew.time_desc))) - .appendTo($NewsBox); - }); - + $.each(asNews.news, function(ikey, asNew) + { + $('

', {'class':'new'}).hide() + .append($('

') + .append($('', {'class':'fa fa-inline fa-30 fa-c-news'})) + .append($('').text(asNew.message))) + .append($('

', {'class':'signature'}) + .text('—'+asNew.nickname) + .append('
') + .append($('', {'class':'news_time'}).text(asNew.time_desc))) + .appendTo($NewsBox); + }); + } + else $('

', {'class':'new'}).hide().text('Aucune news.').appendTo($NewsBox); + $NewsBox.find('.loading').hide(); $NewsBox.find('.new').toggle(); $NewsBox.find('.new:hidden').remove(); diff --git a/style/screen.css b/style/screen.css index 765dbf5..f52582c 100644 --- a/style/screen.css +++ b/style/screen.css @@ -2436,9 +2436,6 @@ vertical-align 0% -5% -10% -15% -20% -25% -30% color:#04357B; margin-top:25px; } -#logout p .fa { - margin-right:5px; -} /* Debug*/