From a737843b7f2278e38f02b00f8cb791446c2b99e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 1 Aug 2013 13:35:42 +0200 Subject: [PATCH 1/1] Fixing borders around inline document node elements which text starts at a new line In case of inline document node elements whose context (text) starts at the beginning of a new line, setting current-node-element on its main node caused a border to start at the end of a previous line and then wrap the next one where texts begins. --- modules/documentCanvas/canvas/canvas.js | 4 ++-- modules/documentCanvas/canvas/documentElement.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/documentCanvas/canvas/canvas.js b/modules/documentCanvas/canvas/canvas.js index bd45273..6f4e089 100644 --- a/modules/documentCanvas/canvas/canvas.js +++ b/modules/documentCanvas/canvas/canvas.js @@ -323,7 +323,7 @@ $.extend(Canvas.prototype, { getCurrentNodeElement: function() { - return this.getDocumentElement(this.wrapper.find('.current-node-element')[0]); + return this.getDocumentElement(this.wrapper.find('.current-node-element').parent()[0]); }, getCurrentTextElement: function() { @@ -351,7 +351,7 @@ $.extend(Canvas.prototype, { element.dom().addClass('current-text-element'); } else { this.wrapper.find('.current-node-element').removeClass('current-node-element') - element.dom().addClass('current-node-element'); + element._container().addClass('current-node-element'); this.publisher('currentElementChanged', element); } }.bind(this); diff --git a/modules/documentCanvas/canvas/documentElement.js b/modules/documentCanvas/canvas/documentElement.js index 3601732..384186f 100644 --- a/modules/documentCanvas/canvas/documentElement.js +++ b/modules/documentCanvas/canvas/documentElement.js @@ -364,7 +364,7 @@ $.extend(DocumentNodeElement.prototype, { }, toggleHighlight: function(toogle) { - this.dom().toggleClass('highlighted-element'); + this._container().toggleClass('highlighted-element'); } }); -- 2.20.1