Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/249896

Change subject: Suggestions: Show list headings as part of list
......................................................................

Suggestions: Show list headings as part of list

Show the titles with white background and connected with suggestion
items.

Bug: T115006
Change-Id: Ief8ef1e5ca6721d2a8f81949fb8eeaf8eb23aa35
---
M modules/dashboard/ext.cx.suggestionlist.js
M modules/dashboard/styles/ext.cx.suggestionlist.less
2 files changed, 18 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/96/249896/1

diff --git a/modules/dashboard/ext.cx.suggestionlist.js 
b/modules/dashboard/ext.cx.suggestionlist.js
index 273c565..2fd7e4e 100644
--- a/modules/dashboard/ext.cx.suggestionlist.js
+++ b/modules/dashboard/ext.cx.suggestionlist.js
@@ -167,7 +167,6 @@
                var params,
                        api = new mw.Api();
 
-
                if ( list.hasMore === false ) {
                        // This method is supposed to be called only if we 
there are items to fetch
                        return $.Deferred().reject();
@@ -737,6 +736,11 @@
                        return;
                }
 
+               list.$list.find( 'h2' ).on( 'click', function () {
+                       // Clicking on header has same effect of clicking on 
the expand, collapse triggers.
+                       list.$list.find( '.cx-suggestionlist__expand, 
.cx-suggestionlist__collapse' ).trigger( 'click' );
+               } );
+
                list.$list.append( $( '<div>' )
                        .addClass( 'cx-suggestionlist__expand' )
                        .text( mw.msg( 'cx-suggestionlist-expand' ) )
diff --git a/modules/dashboard/styles/ext.cx.suggestionlist.less 
b/modules/dashboard/styles/ext.cx.suggestionlist.less
index a1afbc1..d84bfc9 100644
--- a/modules/dashboard/styles/ext.cx.suggestionlist.less
+++ b/modules/dashboard/styles/ext.cx.suggestionlist.less
@@ -7,6 +7,19 @@
        border-bottom: none;
 }
 
+.cx-suggestionlist--expanded h2,
+.cx-suggestionlist--collapsed h2 {
+       .mw-ui-one-whole;
+       float: left;
+       border-bottom: none;
+       background-color: #fff;
+       border: 1px solid #ddd;
+       border-bottom: 0;
+       padding: 10px;
+       margin: 20px 0 0 0;
+       cursor: pointer;
+}
+
 .cx-suggestionlist--collapsed {
        // First item is heading and then next 2 items.
        // So hide all items starting at 4th child.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief8ef1e5ca6721d2a8f81949fb8eeaf8eb23aa35
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to