r103658 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103657‎ | r103658 | r103659 >
Date:11:01, 19 November 2011
Author:hashar
Status:resolved (Comments)
Tags:
Comment:
add click handler to switch instantly between pics

Follow up request by Bryan on r103309
Modified paths:
  • /trunk/extensions/VipsScaler/modules/ext.vipsScaler/ext.vipsScaler.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VipsScaler/modules/ext.vipsScaler/ext.vipsScaler.js
@@ -52,6 +52,24 @@
5353 caption: true,
5454 reveal: 0.5
5555 });
 56+
 57+ /** Also add a click handler to instantly switch beetween pics */
 58+ $('#mw-vipstest-thumbnails').click( function() {
 59+ var e = $(this)
 60+ var mask = e.children(".uc-mask")
 61+ var caption = e.children(".uc-caption")
 62+
 63+ width = e.width();
 64+ maskWidth = mask.width();
 65+
 66+ if( maskWidth < width / 2 ) {
 67+ mask.width( width );
 68+ caption.html( e.children("img:eq(0)").attr("alt") );
 69+ } else {
 70+ mask.width( 0 );
 71+ caption.html( e.children("img:eq(1)").attr("alt") );
 72+ }
 73+ });
5674 }
5775 }
5876 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r104414Add a checkbox to switch between thumbnails...hashar09:53, 28 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103309Better image comparaison using jquery.ucompare...hashar10:38, 16 November 2011

Comments

#Comment by Tim Starling (talk | contribs)   03:43, 28 November 2011

On some laptops, it might be difficult to click without moving the cursor at all. If the cursor moves even a pixel, then the divider will snap back to the cursor location. A checkbox would probably be easier to use.

#Comment by Hashar (talk | contribs)   09:54, 28 November 2011

Good idea! Checkbox was added by r104414. When focused, you can use the space bar to check/uncheck it :-)

Status & tagging log