Skip to content

Commit

Permalink
fixes issue slab#681 with pasteHtml incorrectly re-hydrating tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnolen committed May 20, 2016
1 parent 5aa3022 commit bd9621d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions formats/indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Parchment from 'parchment';
class IdentAttributor extends Parchment.Attributor.Class {
add(node, value) {
if (value === '+1' || value === '-1') {
let indent = parseInt(this.value(node) || 0);
value = value === '+1' ? (indent + 1) : (indent - 1);
let indent = this.value(node) || 0;
value = (value === '+1' ? (indent + 1) : (indent - 1));
}
if (value === 0) {
this.remove(node);
Expand All @@ -13,6 +13,9 @@ class IdentAttributor extends Parchment.Attributor.Class {
return super.add(node, value);
}
}
value(node){
return parseInt(super.value(node));
}
}

let IndentClass = new IdentAttributor('indent', 'ql-indent', {
Expand Down
2 changes: 1 addition & 1 deletion modules/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class Toolbar extends Module {
option.selected = true;
}
} if (input.value) {
input.classList.toggle('ql-active', input.value == formats[format]); // Intentional ==
input.classList.toggle('ql-active', input.value === formats[format]);
} else {
input.classList.toggle('ql-active', formats[format] || false);
}
Expand Down

0 comments on commit bd9621d

Please sign in to comment.