8
0
Просмотр исходного кода

Code refactoring: Fixed confusing variable names in helpers.

Aleksander Nowodzinski 7 лет назад
Родитель
Сommit
6e994c6b55

+ 8 - 8
packages/ckeditor5-engine/src/utils/bindtwostepcarettoattribute.js

@@ -531,28 +531,28 @@ function isAtBoundary( position, attribute ) {
 // @param {String} attribute
 function isAtStartBoundary( position, attribute ) {
 	const { nodeBefore, nodeAfter } = position;
-	const isAttrBefore = nodeAfter ? nodeAfter.hasAttribute( attribute ) : false;
-	const isAttrAfter = nodeBefore ? nodeBefore.hasAttribute( attribute ) : false;
+	const isAttrBefore = nodeBefore ? nodeBefore.hasAttribute( attribute ) : false;
+	const isAttrAfter = nodeAfter ? nodeAfter.hasAttribute( attribute ) : false;
 
-	return isAttrBefore && ( !isAttrAfter || nodeBefore.getAttribute( attribute ) !== nodeAfter.getAttribute( attribute ) );
+	return isAttrAfter && ( !isAttrBefore || nodeBefore.getAttribute( attribute ) !== nodeAfter.getAttribute( attribute ) );
 }
 
 // @param {module:engine/model/position~Position} position
 // @param {String} attribute
 function isAtEndBoundary( position, attribute ) {
 	const { nodeBefore, nodeAfter } = position;
-	const isAttrBefore = nodeAfter ? nodeAfter.hasAttribute( attribute ) : false;
-	const isAttrAfter = nodeBefore ? nodeBefore.hasAttribute( attribute ) : false;
+	const isAttrBefore = nodeBefore ? nodeBefore.hasAttribute( attribute ) : false;
+	const isAttrAfter = nodeAfter ? nodeAfter.hasAttribute( attribute ) : false;
 
-	return isAttrAfter && ( !isAttrBefore || nodeBefore.getAttribute( attribute ) !== nodeAfter.getAttribute( attribute ) );
+	return isAttrBefore && ( !isAttrAfter || nodeBefore.getAttribute( attribute ) !== nodeAfter.getAttribute( attribute ) );
 }
 
 // @param {module:engine/model/position~Position} position
 // @param {String} attribute
 function isBetweenDifferentValues( position, attribute ) {
 	const { nodeBefore, nodeAfter } = position;
-	const isAttrBefore = nodeAfter ? nodeAfter.hasAttribute( attribute ) : false;
-	const isAttrAfter = nodeBefore ? nodeBefore.hasAttribute( attribute ) : false;
+	const isAttrBefore = nodeBefore ? nodeBefore.hasAttribute( attribute ) : false;
+	const isAttrAfter = nodeAfter ? nodeAfter.hasAttribute( attribute ) : false;
 
 	if ( !isAttrAfter || !isAttrBefore ) {
 		return;