https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113437
Revision: 113437
Author: catrope
Date: 2012-03-09 00:38:34 +0000 (Fri, 09 Mar 2012)
Log Message:
-----------
Fix stupid typos so wrapEach actually works
Modified Paths:
--------------
trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.DocumentNode.js
Modified:
trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.DocumentNode.js
===================================================================
--- trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.DocumentNode.js
2012-03-09 00:31:51 UTC (rev 113436)
+++ trunk/extensions/VisualEditor/modules/ve/dm/nodes/ve.dm.DocumentNode.js
2012-03-09 00:38:34 UTC (rev 113437)
@@ -1173,7 +1173,7 @@
tx.pushReplace( unwrapOuter, wrapOuter );
}
- if ( wrapEach.length > 0 && unwrapEach.length > 0 ) {
+ if ( wrapEach.length > 0 || unwrapEach.length > 0 ) {
var closingUnwrapEach = closingArray( unwrapEach ),
closingWrapEach = closingArray( wrapEach ),
depth = 0,
@@ -1183,11 +1183,11 @@
// TODO figure out if we should use the tree/node functions here
// rather than iterating over offsets, it may or may not be
faster
for ( i = range.start; i < range.end; i++ ) {
- if ( this.data[offset].type === undefined ) {
+ if ( this.data[i].type === undefined ) {
// This is a content offset, skip
} else {
// This is a structural offset
- if ( this.data[offset].type.charAt( 0 ) != '/'
) {
+ if ( this.data[i].type.charAt( 0 ) != '/' ) {
// This is an opening element
if ( depth == 0 ) {
// We are at the start of a
top-level element
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs