From 37c0b78349957c3c3e7f59d9a98b12ab4d587e1c Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 5 May 2012 17:48:04 +0200 Subject: [PATCH] Fixed wrong use of splice(). --- .../javascripts/app/controllers/agent_ticket_zoom.js.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/agent_ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/agent_ticket_zoom.js.coffee index 54c46f0b1..5941ae5dc 100644 --- a/app/assets/javascripts/app/controllers/agent_ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/agent_ticket_zoom.js.coffee @@ -81,14 +81,14 @@ class Index extends App.Controller article_lines = article['html'].split(/\n/) if article_lines.length > preview preview_mode = true - article_lines.splice( preview+1, 1, "----SEEMORE----" ) + article_lines.splice( preview, 0, "----SEEMORE----" ) article['html'] = article_lines.join("\n") article['html'] = window.linkify( article['html'] ) - notify = "" + T('See more') + "" + notify = "" + T('See more') + "" # preview mode if preview_mode - article['html'] = article['html'].replace /^----SEEMORE----/m, (match) => + article['html'] = article['html'].replace /^----SEEMORE----\n/m, (match) => notify + '
' article['html'] = article['html'] + '
'