]> git.mxchange.org Git - friendica.git/commitdiff
forumlist: fix id conflict and js show-more
authorrabuzarus <>
Tue, 17 Nov 2015 19:57:12 +0000 (20:57 +0100)
committerrabuzarus <>
Tue, 17 Nov 2015 19:57:12 +0000 (20:57 +0100)
include/forums.php
view/templates/widget_forumlist.tpl

index e604a3156777a14638d0a697889c713f069bc341..00b7bd6ce1e5a4bcbadf51b0671b653dbc98690c 100644 (file)
@@ -74,7 +74,7 @@ function widget_forumlist($a) {
 
        $contacts = get_forumlist($a->user['uid'],true,$lastitem, true);
        $total = count($contacts);
-       $visible_forums = 10;
+       $visible_forums = 1;
 
        if(count($contacts)) {
 
index 4d155fd0ad99a565172e9a4c9418fcea573cb5fe..cfc3f8cbcc118a3729eacff09875a83a5e9126de 100644 (file)
@@ -1,13 +1,13 @@
 <script>
 
 function showHideForumlist() {
-       if( $('#forum-widget-entry-extended').is(':visible')) {
-               $('#forum-widget-entry-extended').hide();
+       if( $("div[id^='forum-widget-entry-extended-']").is(':visible')) {
+               $("div[id^='forum-widget-entry-extended-']").hide();
                $('#forum-widget-collapse').html(window.showMore);
 
        }
        else {
-               $('#forum-widget-entry-extended').show();
+               $("div[id^='forum-widget-entry-extended-']").show();
                $('#forum-widget-collapse').html(window.showFewer);
        }
        }
@@ -18,7 +18,7 @@ function showHideForumlist() {
 
        {{foreach $forums as $forum}}
                {{if $forum.id <= $visible_forums}}
-               <div class="forum-widget-entry" id="forum-widget-entry" role="menuitem">
+               <div class="forum-widget-entry" id="forum-widget-entry-{{$forum.id}}" role="menuitem">
                        <a href="{{$forum.external_url}}" title="{{$forum.link_desc}}" class="label sparkle" target="_blank">
                                <img class="forumlist-img" src="{{$forum.micro}}" alt="{{$forum.link_desc}}" />
                        </a>
@@ -27,7 +27,7 @@ function showHideForumlist() {
                {{/if}}
        
                {{if $forum.id > $visible_forums}}
-               <div class="forum-widget-entry" id="forum-widget-entry-extended" role="menuitem" style="display: none;">
+               <div class="forum-widget-entry" id="forum-widget-entry-extended-{{$forum.id}}" role="menuitem" style="display: none;">
                        <a href="{{$forum.external_url}}" title="{{$forum.link_desc}}" class="label sparkle" target="_blank">
                                <img class="forumlist-img" src="{{$forum.micro}}" alt="{{$forum.link_desc}}" />
                        </a>