Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Code refactoring: Fixed confusing variable names in helpers.
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Apr 18, 2018
1 parent 649f76d commit 24f8e2f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/utils/bindtwostepcarettoattribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 24f8e2f

Please sign in to comment.