EBernhardson (WMF) has submitted this change and it was merged.

Change subject: Topic folding.
......................................................................


Topic folding.

Change-Id: If9461bb5b08deabc8093929791c9d895987fd82e
---
M modules/discussion/base.css
M modules/discussion/ui.js
M templates/topic.html.php
3 files changed, 27 insertions(+), 10 deletions(-)

Approvals:
  EBernhardson (WMF): Verified; Looks good to me, approved



diff --git a/modules/discussion/base.css b/modules/discussion/base.css
index 08de39f..2892d0f 100644
--- a/modules/discussion/base.css
+++ b/modules/discussion/base.css
@@ -118,9 +118,9 @@
     background-image:      -o-linear-gradient(left, rgba(0,0,0,0), 
rgba(0,0,0,0.75), rgba(0,0,0,0)); 
 }
 
-.opener {
-       position: relative;
-       left: 0;
+.flow-topic-opener {
+       position: absolute;
+       left: -24px;
        top: 0;
        width: 20px;
        height: 20px;
@@ -129,7 +129,7 @@
        background-image: url(images/topic_control_read_down.png);
 }
 
-.mentiondicator {
+.flow-topic-mention-indicator {
        position: relative;
        float: left;
        top: 9;
@@ -143,11 +143,11 @@
        background-repeat: no-repeat;
        background-position: center bottom;
 }
-.closedtopic.hasmention .flow-topic-datestamp {
+.flow-topic-closed.hasmention .flow-topic-datestamp {
        margin-left: -13px;
 }
 
-.postmention {
+.flow-post-mention-indicator {
        position: relative;
        float: left;
        top: 10;
@@ -166,20 +166,20 @@
        margin-left: -10px;
 }
 
-.opentopic .mentiondicator {
+.flow-topic-container .flow-topic-mention-indicator {
        display: none;
 }
 
-div.closedtopic div.opener {
+div.flow-topic-closed div.flow-topic-opener {
        /* @embed */
        background-image: url(images/topic_control_read_right.png);     
 }
 
-.containsunread .opener {
+.containsunread .flow-topic-opener {
        /* @embed */
        background-image: url(images/topic_control_unread_down.png);    
 }
-.containsunread.closedtopic .opener {
+.containsunread.flow-topic-closed .flow-topic-opener {
        /* @embed */
        background-image: url(images/topic_control_unread_right.png);   
 }
diff --git a/modules/discussion/ui.js b/modules/discussion/ui.js
index 6985fe6..68c5932 100644
--- a/modules/discussion/ui.js
+++ b/modules/discussion/ui.js
@@ -86,6 +86,22 @@
                                        } );
                        } )
                        .insertBefore( $container.find('.flow-newtopic-form 
input[type=submit]') );
+
+               // Set up folding
+               $container.find( '.flow-topic-opener' )
+                       .click( function(e) {
+                               var $topicContainer = 
$(this).closest('.flow-topic-container')
+                                       .toggleClass( 'flow-topic-closed' );
+
+                               var $hideElement = 
$(this).closest('.flow-topic-container')
+                                       .children( '.flow-post-container' );
+
+                                       if ( $topicContainer.hasClass( 
'flow-topic-closed' ) ) {
+                                               $hideElement.slideUp();
+                                       } else {
+                                               $hideElement.slideDown();
+                                       }
+                       } );
        } );
 
        $('body')
diff --git a/templates/topic.html.php b/templates/topic.html.php
index 2d24847..ee9a4db 100644
--- a/templates/topic.html.php
+++ b/templates/topic.html.php
@@ -11,6 +11,7 @@
        'data-title' => $title,
 ) );
 ?>
+<div class="flow-topic-opener"></div>
 <div class="flow-titlebar">
        <div class="flow-topic-title">
                <div class="flow-realtitle">

-- 
To view, visit https://gerrit.wikimedia.org/r/79354
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If9461bb5b08deabc8093929791c9d895987fd82e
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Werdna <agarr...@wikimedia.org>
Gerrit-Reviewer: EBernhardson (WMF) <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Werdna <agarr...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to