r104790 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104789‎ | r104790 | r104791 >
Date:23:40, 30 November 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Split name and label functionality of toolbar config
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/views/es.ContextView.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/views/es.ToolbarView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/views/es.ContextView.js
@@ -14,7 +14,11 @@
1515 .appendTo( this.$ );
1616 this.$icon = $( '<div class="es-contextView-icon"></div>' )
1717 .appendTo( this.$ );
18 - this.toolbarView = new es.ToolbarView( this.$toolbar, this.surfaceView );
 18+ this.toolbarView = new es.ToolbarView(
 19+ this.$toolbar,
 20+ this.surfaceView,
 21+ [{ 'name': 'textStyle', 'items' : [ 'bold', 'italic', 'formatting', 'clear' ] }]
 22+ );
1923
2024 // Example menu items
2125 this.$menu.append(
Index: trunk/extensions/VisualEditor/modules/es/views/es.ToolbarView.js
@@ -37,7 +37,7 @@
3838 } );
3939
4040 this.config = config || [
41 - { name: 'text', items : [ 'bold', 'italic', 'formatting', 'clear' ] },
 41+ { 'name': 'textStyle', 'items' : [ 'bold', 'italic', 'formatting', 'clear' ] },
4242 ];
4343
4444 this.setup()
@@ -54,10 +54,12 @@
5555 for ( var i = 0; i < this.config.length; i++ ) {
5656 var $group = $( '<div>' )
5757 .addClass( 'es-toolbarGroup' )
58 - .addClass( 'es-toolbarGroup-' + this.config[i].name )
59 - .append(
60 - $( '<div>' ).addClass( 'es-toolbarLabel' ).html( this.config[i].name )
 58+ .addClass( 'es-toolbarGroup-' + this.config[i].name );
 59+ if ( this.config[i].label ) {
 60+ $group.append(
 61+ $( '<div>' ).addClass( 'es-toolbarLabel' ).html( this.config[i].label )
6162 );
 63+ }
6264
6365 for ( var j = 0; j < this.config[i].items.length; j++ ) {
6466 var toolDefintion = es.Tool.tools[ this.config[i].items[j] ];

Status & tagging log