function navigateLeft() { // Reverse for RTL if( config.rtl ) { if( ( isOverview() || nextFragment() === false ) && availableRoutes().left ) { slide( indexh + 1 ); } } // Normal navigation else if( ( isOverview() || previousFragment() === false ) && availableRoutes().left ) { slide( indexh - 1 ); } }
function * fixDestructuring(node, source, fixer) { const {left} = getDestructuringLeftAndRight(node); const [element] = left.elements; const leftText = source.getText(element.type === 'AssignmentPattern' ? element.left : element); yield fixer.replaceText(left, leftText); // `AssignmentExpression` always starts with `[` or `(`, so we don't need check ASI if (assignmentNeedParenthesize(node, source)) { yield fixer.insertTextBefore(node, '('); yield fixer.insertTextAfter(node, ')'); } }
move(x = 0, y = 0) { let res = ''; res += (x < 0) ? cursor.left(-x) : (x > 0) ? cursor.right(x) : ''; res += (y < 0) ? cursor.up(-y) : (y > 0) ? cursor.down(y) : ''; return res; }
getAnchor(isVertical, anchor, clearance, tooltipWidth, tooltipHeight) { if (isVertical) { return this.transformAnchor(anchor, clearance.left, clearance.right, tooltipWidth, clearance.boundingRect.width); } return this.transformAnchor(anchor, clearance.top, clearance.bottom, tooltipHeight, clearance.boundingRect.height); }
test( 'Loop', function() { Reveal.configure({ loop: true }); Reveal.slide( 0, 0 ); Reveal.left(); notEqual( Reveal.getIndices().h, 0, 'looped from start to end' ); Reveal.right(); equal( Reveal.getIndices().h, 0, 'looped from end to start' ); Reveal.configure({ loop: false }); });
getNodeClearance(domNode) { const viewportHeight = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0); const viewportWidth = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0); const boundingRect = domNode.getBoundingClientRect(); return { bottom: viewportHeight - boundingRect.bottom, left: boundingRect.left, right: viewportWidth - boundingRect.right, top: boundingRect.top, boundingRect, }; }
// Wait for correct rendering of medias and such before calculating rect size setTimeout(() => { let rect = draggedModal.getBoundingClientRect(); draggedModal.posX = rect.left; draggedModal.posY = rect.top; }, 500);
const isReferenceAssigned = expression => { if (expression.type === 'AssignmentExpression') { const assignedVariable = expression.left; return assignedVariable.type === 'Identifier' && assignedVariable.name; } return false; }
const isLiteralOnePlusIdentifierWithName = (node, identifierName) => { if (node && node.type === 'BinaryExpression' && node.operator === '+') { return (isIdentifierWithName(node.left, identifierName) && isLiteralOne(node.right)) || (isIdentifierWithName(node.right, identifierName) && isLiteralOne(node.left)); } return false; }
function checkBinaryExpression(context, node, options) { if ( node.right.type === 'Literal' && node.left.type === 'MemberExpression' && node.left.property.type === 'Identifier' && node.left.property.name === 'length' ) { checkZeroType(context, node); checkNonZeroType(context, node, options['non-zero']); } }
// Wait for correct rendering of medias and such before calculating rect size setTimeout(() => { let rect = draggedModal.getBoundingClientRect(); draggedModal.posX = rect.left; draggedModal.posY = rect.top; }, 500);