Skip to content

Commit 1dd9eaf

Browse files
committed
Fixes issue with fixtures when reverting changes.
1 parent 23a09b2 commit 1dd9eaf

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

build/content-tools.js

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/content-tools.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ContentTools",
33
"description": "A JS library for building WYSIWYG editors for HTML content",
4-
"version": "1.5.0",
4+
"version": "1.5.1",
55
"keywords": [
66
"wysiwyg",
77
"inline",

src/scripts/editor.coffee

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,16 @@ class _EditorApp extends ContentTools.ComponentUI
494494
for child in region.children
495495
child.unmount()
496496

497-
region.domElement().innerHTML = snapshot.regions[name]
497+
# Handle fixtures vs. standard regions
498+
if region.children.length is 1 and region.children[0].isFixed()
499+
wrapper = @constructor.createDiv()
500+
wrapper.innerHTML = snapshot.regions[name]
501+
region.domElement().parentNode.replaceChild(
502+
wrapper.firstElementChild,
503+
region.domElement()
504+
)
505+
else
506+
region.domElement().innerHTML = snapshot.regions[name]
498507

499508
# Check to see if we need to restore the regions to an editable state
500509
if restoreEditable
@@ -553,6 +562,7 @@ class _EditorApp extends ContentTools.ComponentUI
553562
for child in region.children
554563
child.unmount()
555564

565+
# Handle fixtures vs. standard regions
556566
if region.children.length is 1 and region.children[0].isFixed()
557567
wrapper = @constructor.createDiv()
558568
wrapper.innerHTML = html

0 commit comments

Comments
 (0)