From fa289cfd4a3f6cc010b9aedecbd45f345c48abb6 Mon Sep 17 00:00:00 2001 From: Chad Weider Date: Tue, 22 May 2012 15:55:43 -0700 Subject: [PATCH] Use methods for this behavior. --- src/static/js/domline.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/static/js/domline.js b/src/static/js/domline.js index 1eb82d02a..c5b4cb9e4 100644 --- a/src/static/js/domline.js +++ b/src/static/js/domline.js @@ -76,8 +76,6 @@ function DOMLine(nonEmpty, doesWrap, browser, document) { this.postHtml = ''; this.curHTML = null; - this.perTextNodeProcess = (doesWrap ? _.identity : this.processSpaces); - this.perHtmlLineProcess = (doesWrap ? this.processSpaces : _.identity); this.lineClass = 'ace-line'; // Apparently overridden at the instance level sometimes... @@ -87,6 +85,23 @@ function DOMLine(nonEmpty, doesWrap, browser, document) { DOMLine.prototype = {}; (function () { + + this.perTextNodeProcess = function (s) { + if (this.doesWrap) { + return _.identity(s); + } else { + return this.processSpaces(s); + } + } + + this.perHtmlLineProcess = function (s) { + if (this.doesWrap) { + return this.processSpaces(s); + } else { + return _.identity(s); + } + } + this.processSpaces = function(s) { return processSpaces(s, this.doesWrap);