From 90a5ba01a35aeb3629ebe76069e68c64b913a4d5 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 31 Mar 2016 23:13:40 +0200 Subject: [PATCH] make fullscreen mode available for other modules and some cleanup --- view/css/mod_chat.css | 14 ------ view/js/main.js | 13 ++++++ view/theme/redbasic/css/style.css | 14 ++++++ view/tpl/chat.tpl | 75 +++++++++++++++---------------- 4 files changed, 62 insertions(+), 54 deletions(-) diff --git a/view/css/mod_chat.css b/view/css/mod_chat.css index 75e858542..3dd8309d3 100644 --- a/view/css/mod_chat.css +++ b/view/css/mod_chat.css @@ -107,17 +107,3 @@ aside { .leave { color: red; } - -.generic-content-wrapper.fullscreen { - position: fixed; - width: 100%; - height: 100%; - top: 0px; - left: 0px; - border-radius: 0px; - z-index: 10000; -} - -.generic-content-wrapper.fullscreen .section-title-wrapper { - border-radius: 0px; -} diff --git a/view/js/main.js b/view/js/main.js index 04b317914..d6d1238d4 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1451,3 +1451,16 @@ function zid(s) { return s; } + +function makeFullScreen(full) { + if(typeof full=='undefined' || full == true) { + $('#fullscreen, aside').hide(); + $('#inline').show(); + $('.generic-content-wrapper').addClass('fullscreen'); + } + else { + $('#fullscreen, aside').show(); + $('#inline').hide(); + $('.generic-content-wrapper').removeClass('fullscreen'); + } +} diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 443f96da9..3172a6520 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1518,6 +1518,20 @@ nav .dropdown-menu { word-wrap: break-word; } +.generic-content-wrapper.fullscreen { + position: fixed; + width: 100%; + height: 100%; + top: 0px; + left: 0px; + border-radius: 0px; + z-index: 10000; +} + +.generic-content-wrapper.fullscreen .section-title-wrapper { + border-radius: 0px; +} + .chatroom-index-row:hover td, .locs-index-row:hover td, [id^="cloud-index-"]:hover td, diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl index 1001f28b3..47b1e83b1 100644 --- a/view/tpl/chat.tpl +++ b/view/tpl/chat.tpl @@ -1,8 +1,8 @@
- - + + {{if $is_owner}}
@@ -109,12 +109,16 @@ $(document).ready(function() { chat_timer = setTimeout(load_chats,300); $('#chatroom_bookmarks, #vcard').hide(); $('#chatroom_list, #chatroom_members').show(); - $('#chatTopBar').height($(window).height() - $('#chatBottomBar').outerHeight(true) - $('.section-title-wrapper').outerHeight(true) - $('nav').outerHeight(true) - 23 ); + adjustInlineTopBarHeight(); }); $(window).resize(function () { - var navHeight = $('.generic-content-wrapper').hasClass('fullscreen') ? 0 : $('nav').outerHeight(true); - $('#chatTopBar').height($(window).height() - $('#chatBottomBar').outerHeight(true) - $('.section-title-wrapper').outerHeight(true) - navHeight - 23); + if($('.generic-content-wrapper').hasClass('fullscreen')) { + adjustFullscreenTopBarHeight(); + } + else { + adjustInlineTopBarHeight(); + } $('#chatTopBar').scrollTop($('#chatTopBar').scrollTop() + $('#chatTopBar').outerHeight(true)); }); @@ -177,7 +181,6 @@ function update_chats(chats) { } - function chatJotGetLink() { reply = prompt("{{$linkurl}}"); if(reply && reply.length) { @@ -194,47 +197,39 @@ function addmailtext(data) { $("#chatText").val(currentText + data); } -function makeFullScreen() { - $('#fullscreen, aside').hide(); - $('#inline').show(); - $('.generic-content-wrapper').addClass('fullscreen'); +function adjustFullscreenTopBarHeight() { $('#chatTopBar').height($(window).height() - $('#chatBottomBar').outerHeight(true) - $('.section-title-wrapper').outerHeight(true) - 23); - } -function makeInline() { - $('#fullscreen, aside').show(); - $('#inline').hide(); - $('.generic-content-wrapper').removeClass('fullscreen'); +function adjustInlineTopBarHeight() { $('#chatTopBar').height($(window).height() - $('#chatBottomBar').outerHeight(true) - $('.section-title-wrapper').outerHeight(true) - $('nav').outerHeight(true) - 23); } - -