mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
Revert "editor: ul/ol/li - outdent on ol and ul button press"
This reverts commit fc88f12bba
.
This commit is contained in:
parent
aff93d24dd
commit
82fb6ddc99
1 changed files with 5 additions and 18 deletions
|
@ -5166,7 +5166,6 @@ function Ace2Inner(){
|
||||||
var t = '';
|
var t = '';
|
||||||
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 togglingOn = !allLinesAreList;
|
|
||||||
if (listType)
|
if (listType)
|
||||||
{
|
{
|
||||||
t = listType[1];
|
t = listType[1];
|
||||||
|
@ -5174,24 +5173,12 @@ function Ace2Inner(){
|
||||||
}
|
}
|
||||||
var t = getLineListType(n);
|
var t = getLineListType(n);
|
||||||
|
|
||||||
if(t === listType) togglingOn = false;
|
// if already a list, deindent
|
||||||
|
if (allLinesAreList && level != 1) { level = level - 1; }
|
||||||
|
// if already indented, then add a level of indentation to the list
|
||||||
|
else if (t && !allLinesAreList) { level = level + 1; }
|
||||||
|
|
||||||
if(togglingOn){
|
mods.push([n, allLinesAreList ? 'indent' + level : (t ? type + level : type + '1')]);
|
||||||
mods.push([n, allLinesAreList ? 'indent' + level : (t ? type + level : type + '1')]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!togglingOn){ // remove removing because we have
|
|
||||||
// scrap the entire indentation and list type
|
|
||||||
if(level === 1){ // if outdending but are the first item in the list then outdent
|
|
||||||
setLineListType(n, ''); // outdent
|
|
||||||
}
|
|
||||||
// else change to indented not bullet
|
|
||||||
if(level > 1){
|
|
||||||
setLineListType(n, ''); // reomve bullet
|
|
||||||
let newLevel = level+1;
|
|
||||||
setLineListType(n, "indent"+level); // outdent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_.each(mods, function(mod){
|
_.each(mods, function(mod){
|
||||||
|
|
Loading…
Reference in a new issue