diff --git a/public/javascripts/community_hub.js b/public/javascripts/community_hub.js index 422ad71..201f37b 100644 --- a/public/javascripts/community_hub.js +++ b/public/javascripts/community_hub.js @@ -3,8 +3,23 @@ var oldest_post_id = 0; live_scroll_position = 0; var mediations = []; -function load_more_messages() { +function load_more(tab) { + switch (tab) { + case 'live': + load_more_messages(); + break; + case 'mediation': + load_more_mediations(); + break; + } +} + + +function load_more_mediations() {i + // implement! +} +function load_more_messages() { var hub_id = jQuery(".hub").attr('id'); var oldest_id = jQuery("#live-posts li.post").last().attr("id"); @@ -312,11 +327,28 @@ function hub_right_tab_click() { first_hub_load = true; -jQuery(".hub .live .envelope").scroll(function() { +jQuery(".hub .envelope").scroll(function() { jQuery("#auto_scrolling").attr('checked', false); - if (jQuery(".hub .live .envelope").scrollTop() == (jQuery(".hub ul#live-posts").height() - jQuery(".hub .live .envelope").height() + 23)) { - load_more_messages(); + + // live stream tab... + if (jQuery("#left-tab.show").size() != 0) { + current_envelope = jQuery(".hub .live .envelope"); + current_list_posts = jQuery(".hub ul#live-posts"); + tab = 'live'; + } + else { + // mediation tab... + if (jQuery("#right-tab.show").size() != 0) { + current_envelope = jQuery(".hub .mediation .envelope"); + current_list_posts = jQuery(".hub ul#mediation-posts"); + tab = 'mediation'; + } + } + + if (current_envelope.scrollTop() == (current_list_posts.height() - current_envelope.height() + 23)) { + load_more(tab); } + }); diff --git a/public/style.css b/public/style.css index e85ebdc..4199f8d 100644 --- a/public/style.css +++ b/public/style.css @@ -122,7 +122,7 @@ .hub .mediation-bar ul li.pin { height: 25px; - margin-right: 15px; + /*margin-right: 15px;*/ } .hub .remove{} @@ -175,35 +175,40 @@ } .hub .envelope { -/* height: 500px; + height: 500px; overflow-x: hidden; - overflow-y: scroll;*/ + overflow-y: scroll; margin-top: -1px; - border-top: 1px solid lightgray; - display: inline-block; + border: 1px solid lightgray; + /*border-bottom: 1px solid lightgray; + border-left: 1px solid lightgray;*/ + /*display: inline-block;*/ width: 100%; } .hub ul#live-posts, .hub ul#mediation-posts{ - border-width: 0 1px 1px; - border-style: solid; - border-color: lightGray; + /*border-width: 0 1px 1px;*/ + /*border-style: solid;*/ + /*border-color: lightGray;*/ + border-bottom: 1px solid lightgray; padding-top: 10px; - clear: both; - height: 475px; - overflow-y: scroll; + /*clear: both;*/ + /*height: 475px;*/ + /*overflow-y: scroll;*/ } /*modificação da scroll bar*/ +.hub div.envelope::-webkit-scrollbar-button /*, .hub ul#live-posts::-webkit-scrollbar-button, -.hub ul#mediation-posts::-webkit-scrollbar-button { +.hub ul#mediation-posts::-webkit-scrollbar-button */ { height: 0; width: 0; } +.hub div.envelope::-webkit-scrollbar-thumb /*, .hub ul#live-posts::-webkit-scrollbar-thumb, -.hub ul#mediation-posts::-webkit-scrollbar-thumb{ +.hub ul#mediation-posts::-webkit-scrollbar-thumb */ { background-clip: padding-box; background-color: rgba(0,0,0,.3); border: 5px solid transparent; @@ -214,8 +219,9 @@ width: 5px; } +.hub div.envelope::-webkit-scrollbar /*, .hub ul#live-posts::-webkit-scrollbar, -.hub ul#mediation-posts::-webkit-scrollbar { +.hub ul#mediation-posts::-webkit-scrollbar */ { height: 15px; width: 15px; } -- libgit2 0.21.2