r51705 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51704‎ | r51705 | r51706 >
Date:19:33, 10 June 2009
Author:tparscal
Status:deferred
Tags:
Comment:
Added page switching functionality
Modified paths:
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js
@@ -200,8 +200,12 @@
201201 $( '<div />' )
202202 .attr( 'class', first ? 'current' : null )
203203 .text( msg( section.pages[page], 'label' ) )
 204+ .data( 'page', page )
204205 .click( function() {
205 - // switch the current item and visible page
 206+ $(this).parent().parent().find( 'div.pages > div.page' ).hide();
 207+ $(this).parent().find( 'div' ).removeClass( 'current' );
 208+ $(this).parent().parent().find( 'div.pages > div.page-' + $(this).data( 'page' ) ).show();
 209+ $(this).addClass( 'current' );
206210 } )
207211 );
208212 first = false;
@@ -213,7 +217,7 @@
214218 for ( page in section.pages ) {
215219 // Appends page
216220 var pageDiv = $( '<div />' )
217 - .attr( 'class', 'page' )
 221+ .attr( 'class', 'page page-' + page )
218222 .appendTo( pagesDiv );
219223 // Checks if there's content for this page
220224 switch ( section.pages[page].layout ) {

Status & tagging log