From 8fb37d9a16760cf9a3de3682afc7854e89e44d5e Mon Sep 17 00:00:00 2001 From: Henrik N Date: Tue, 1 Mar 2011 21:01:55 +0100 Subject: [PATCH] Account for Haml indenting non-first line of confirmation. --- src/rails.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rails.js b/src/rails.js index e99d49e9..d0880ca3 100644 --- a/src/rails.js +++ b/src/rails.js @@ -99,6 +99,10 @@ function allowAction(element) { var message = element.attr('data-confirm'); + // Account for Haml indenting other lines than the first one. + if (message) { + message = message.replace(/\n */g, "\n"); + } return !message || (fire(element, 'confirm') && confirm(message)); }