Index: trunk/extensions/VisualEditor/modules/es/tools/es.ListButtonTool.js |
— | — | @@ -7,7 +7,8 @@ |
8 | 8 | };
|
9 | 9 |
|
10 | 10 | es.ListButtonTool.prototype.updateState = function( annotations, nodes ) {
|
11 | | - function areSameTypeAndStyle( nodes, style ) {
|
| 11 | + // checks if all passed nodes are listItems of passed style
|
| 12 | + function check( nodes, style ) {
|
12 | 13 | for( var i = 0; i < nodes.length; i++ ) {
|
13 | 14 | parent = nodes[i].getParent();
|
14 | 15 | if ( parent.getElementType() !== 'listItem' ) {
|
— | — | @@ -21,7 +22,7 @@ |
22 | 23 | return true;
|
23 | 24 | }
|
24 | 25 |
|
25 | | - if ( areSameTypeAndStyle( nodes, this.name ) ) {
|
| 26 | + if ( check( nodes, this.name ) ) {
|
26 | 27 | this.$.addClass( 'es-toolbarButtonTool-down' );
|
27 | 28 | } else {
|
28 | 29 | this.$.removeClass( 'es-toolbarButtonTool-down' );
|