fix indent bug

Signed-off-by: zhanghongchuan33 <zhanghongchuan6@huawei.com>
This commit is contained in:
zhanghongchuan33 2022-05-12 16:20:54 +08:00
parent 4cb8d4dd51
commit d866d18c94

View File

@ -219,12 +219,23 @@ RICH_EDITOR.execFontSize = function (size, unit) {
fontElements.style.fontSize = size + 'px'
};
var pad = 24
RICH_EDITOR.setIndent = function() {
document.execCommand('indent', false, null);
var parents = document.getElementById('editorjs')
parents.removeAttribute('padding-left');
pad = pad + 24
parents.style.paddingLeft = pad + 'px'
}
RICH_EDITOR.setOutdent = function() {
document.execCommand('outdent', false, null);
var parents = document.getElementById('editorjs')
parents.removeAttribute('padding-left');
if (pad == 24) {
parents.style.paddingLeft = 24 + 'px'
} else {
pad = pad - 24
parents.style.paddingLeft = pad + 'px'
}
}
RICH_EDITOR.setJustifyLeft = function() {