From cfe75c7f3f951ebae00255dd3799944c0a92ce68 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 30 Dec 2014 17:45:26 +0100 Subject: [PATCH] Clean-up after removing list attribute: Remove list numbering attribute --- src/static/js/AttributeManager.js | 4 ++-- src/static/js/ace2_inner.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/static/js/AttributeManager.js b/src/static/js/AttributeManager.js index 1da1056ab..a11f6cef6 100644 --- a/src/static/js/AttributeManager.js +++ b/src/static/js/AttributeManager.js @@ -169,11 +169,11 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({ if(attrib[0] === attributeName) return [attributeName, null] return attrib }) - + if(hasMarker){ ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 0])); // If length == 4, there's [author, lmkr, insertorder, + the attrib being removed] thus we can remove the marker entirely - if(attribs.length == 4) ChangesetUtils.buildRemoveRange(this.rep, builder, loc, (loc = [lineNum, 1])) + if(attribs.length <= 4) ChangesetUtils.buildRemoveRange(this.rep, builder, loc, (loc = [lineNum, 1])) else ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 1]), attribs, this.rep.apool); } diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index f1fc11600..86f69bab9 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -5073,6 +5073,7 @@ function Ace2Inner(){ { if(listType == ''){ documentAttributeManager.removeAttributeOnLine(lineNum, listAttributeName); + documentAttributeManager.removeAttributeOnLine(lineNum, 'start'); }else{ documentAttributeManager.setAttributeOnLine(lineNum, listAttributeName, listType); }