lets try this

outdent-ol-on-click
John McLear 2020-06-06 22:55:32 +00:00
parent 34ea1e0438
commit 3eec0a0f7f
1 changed files with 3 additions and 7 deletions

View File

@ -5167,13 +5167,11 @@ function Ace2Inner(){
var level = 0; var level = 0;
var listType = /([a-z]+)([0-9]+)/.exec(getLineListType(n)); var listType = /([a-z]+)([0-9]+)/.exec(getLineListType(n));
var togglineOn = false;
// Used to outdent if ol is removed // Used to outdent if ol is removed
if(allLinesAreList){ if(allLinesAreList){
togglingOn = false; var togglingOn = false;
}else{ }else{
togglingOn = true; var togglingOn = true;
} }
if (listType) if (listType)
@ -5187,9 +5185,7 @@ function Ace2Inner(){
if(togglingOn){ if(togglingOn){
mods.push([n, allLinesAreList ? 'indent' + level : (t ? type + level : type + '1')]); mods.push([n, allLinesAreList ? 'indent' + level : (t ? type + level : type + '1')]);
} }else{
if(!togglingOn){
// scrap the entire indentation and list type // scrap the entire indentation and list type
if(level === 1){ // if outdending but are the first item in the list then outdent if(level === 1){ // if outdending but are the first item in the list then outdent
setLineListType(n, ''); // outdent setLineListType(n, ''); // outdent