r55422 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55421‎ | r55422 | r55423 >
Date:18:58, 21 August 2009
Author:werdna
Status:deferred
Tags:
Comment:
Per Trevor and Brion:
* Show the menu on hovering over the down arrow, hide it when leaving the toolbar.
* Fix problem with icon display (change lqt-command-icon to just using the a, which now is display: block.
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/View.php (modified) (history)
  • /trunk/extensions/LiquidThreads/lqt.css (modified) (history)
  • /trunk/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/lqt.css
@@ -279,7 +279,7 @@
280280 background-repeat: no-repeat;
281281 height: 80%;
282282 width: 1em;
283 - height: 1em;
 283+ height: 2em;
284284 padding-bottom: 0.2em;
285285 padding-left: 26px;
286286 }
@@ -384,7 +384,7 @@
385385 padding-right: 8px;
386386 }
387387
388 -.lqt-thread-toolbar .lqt-command-icon {
 388+.lqt-thread-toolbar-commands > .lqt-command > a {
389389 height: 1.25em;
390390 background-repeat: no-repeat;
391391 background-position: center;
@@ -398,18 +398,23 @@
399399 margin-right: 8px;
400400 }
401401
402 -.lqt-command-edit .lqt-command-icon {
 402+.lqt-thread-toolbar .lqt-command > a {
 403+ display: block;
 404+}
 405+
 406+.lqt-thread-toolbar-commands > .lqt-command-edit a {
403407 background-image: url(icons/edit.png);
404408 padding-left: 26px;
405409 }
406410
407 -.lqt-command-reply .lqt-command-icon {
 411+.lqt-thread-toolbar-commands > .lqt-command-reply a {
408412 background-image: url(icons/reply.png);
409 - padding-left: 24px;
 413+ background-position: left;
 414+ padding-left: 26px;
410415 margin-left: 8px;
411416 }
412417
413 -.lqt-command-link .lqt-command-icon {
 418+.lqt-command-link a {
414419 background-image: url(icons/link.png) !important;
415420 padding-left: 26px;
416421 }
Index: trunk/extensions/LiquidThreads/classes/View.php
@@ -657,7 +657,7 @@
658658 $headerParts = array();
659659
660660 foreach( $this->threadMajorCommands( $thread ) as $key => $cmd ) {
661 - $content = $this->contentForCommand( $cmd );
 661+ $content = $this->contentForCommand( $cmd, false /* No icon divs */ );
662662 $headerParts[] = Xml::tags( 'li',
663663 array( 'class' => "lqt-command lqt-command-$key" ),
664664 $content );
@@ -711,7 +711,7 @@
712712 return join( ' ', $result );
713713 }
714714
715 - function contentForCommand( $command ) {
 715+ function contentForCommand( $command, $icon_divs = true ) {
716716 $label = $command['label'];
717717 $href = $command['href'];
718718 $enabled = $command['enabled'];
@@ -720,11 +720,16 @@
721721 global $wgScriptPath;
722722 $icon = Xml::tags( 'div', array( 'title' => $label,
723723 'class' => 'lqt-command-icon' ), ' ' );
724 -
725 - if ( !empty($command['showlabel']) ) {
726 - $label = $icon.' '.$label;
 724+ if ($icon_divs) {
 725+ if ( !empty($command['showlabel']) ) {
 726+ $label = $icon.' '.$label;
 727+ } else {
 728+ $label = $icon;
 729+ }
727730 } else {
728 - $label = $icon;
 731+ if ( empty($command['showlabel']) ) {
 732+ $label = '';
 733+ }
729734 }
730735 }
731736
Index: trunk/extensions/LiquidThreads/lqt.js
@@ -205,7 +205,10 @@
206206 menuContainer.find('.lqt-thread-toolbar-command-list').hide();
207207
208208 var menuTrigger = menuContainer.find( '.lqt-thread-actions-trigger' );
209 - menuTrigger.click( function() { menu.slideToggle(); } );
 209+
 210+ menuTrigger.hover( function() { menu.slideDown(); } );
 211+ toolbar.hover( function() {}, function() { menu.slideUp(); } );
 212+
210213 menuTrigger.show();
211214 },
212215 }

Status & tagging log