js/arrangeTiles.js
// Creates our game over modal and adds appropriate content, then shows the modal.
Creates our game over modal and adds appropriate content, then shows the modal.
Creates our game over modal and adds appropriate content then shows the modal .
function showGameOverModal(timeTaken, newBestTime, newBestMoves) {
            var modal = fromTemplate(gameOverTemplate),
                modalBody = modal.find('.modal-body'),
                timeText = (newBestTime) ? fromTemplate(newBestTimeTemplate) : fromTemplate(timeTakenTemplate),
                movesText = (newBestMoves) ? fromTemplate(newBestMovesTemplate) : fromTemplate(numMovesTemplate);
            timeText.find(".time-taken")
                    .text(timeTaken.toString());
            movesText.find(".num-moves")
                     .text(currentNumMoves.toString());
            modalBody.append(timeText)
                     .append(movesText);
            $("body").append(modal);
            modal.modal({
                backdrop: 'static'
            });
            modal.modal('show');
        }
function showGameOverModal ( timeTaken , newBestTime , newBestMoves ) { var modal = fromTemplate ( gameOverTemplate ) , modalBody = modal . find ( '.modal-body' ) , timeText = ( newBestTime ) ? fromTemplate ( newBestTimeTemplate ) : fromTemplate ( timeTakenTemplate ) , movesText = ( newBestMoves ) ? fromTemplate ( newBestMovesTemplate ) : fromTemplate ( numMovesTemplate ) ; timeText . find ( ".time-taken" ) . text ( timeTaken . toString ( ) ) ; movesText . find ( ".num-moves" ) . text ( currentNumMoves . toString ( ) ) ; modalBody . append ( timeText ) . append ( movesText ) ; $ ( "body" ) . append ( modal ) ; modal . modal ( { backdrop : 'static' } ) ; modal . modal ( 'show' ) ; }
Creates our game over modal and adds appropriate content, then shows the modal.
Creates our game over modal and adds appropriate content then shows the modal .