Skip to content

Commit

Permalink
- Fix for #501.
Browse files Browse the repository at this point in the history
- Fix for using when with conditionals (not allowed)
  • Loading branch information
anthonyjb committed May 21, 2018
1 parent f3cd763 commit 5a8fe95
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 50 deletions.
55 changes: 33 additions & 22 deletions build/content-tools.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/content-tools.min.css

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions build/content-tools.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ContentTools",
"description": "A JS library for building WYSIWYG editors for HTML content",
"version": "1.6.4",
"version": "1.6.5",
"keywords": [
"wysiwyg",
"inline",
Expand Down
2 changes: 1 addition & 1 deletion spec/content-tools-spec.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/scripts/editor.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ class _EditorApp extends ContentTools.ComponentUI
continue

# Skip whitespace text elements
if node.nodeName = '#text' and node.textContent.trim() == ''
if node.nodeName == '#text' and node.textContent.trim() == ''
continue

# Attempt to convert the node to a ContentEdit element
Expand Down
35 changes: 19 additions & 16 deletions src/scripts/ui/toolbox.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -275,21 +275,24 @@ class ContentTools.ToolboxUI extends ContentTools.WidgetUI
undo = false

switch os
when 'linux' and not ev.altKey
if ev.keyCode is 90 and ev.ctrlKey
redo = ev.shiftKey
undo = not redo

when 'mac' and not (ev.altKey or ev.ctrlKey)
if ev.keyCode is 90 and ev.metaKey
redo = ev.shiftKey
undo = not redo

when 'windows' and not ev.altKey or ev.shiftKey
if ev.keyCode is 89 and ev.ctrlKey
redo = true
if ev.keyCode is 90 and ev.ctrlKey
undo = true
when 'linux'
if not ev.altKey
if ev.keyCode is 90 and ev.ctrlKey
redo = ev.shiftKey
undo = not redo

when 'mac'
if not (ev.altKey or ev.ctrlKey)
if ev.keyCode is 90 and ev.metaKey
redo = ev.shiftKey
undo = not redo

when 'windows'
if not ev.altKey or ev.shiftKey
if ev.keyCode is 89 and ev.ctrlKey
redo = true
if ev.keyCode is 90 and ev.ctrlKey
undo = true

# Perform undo/redo
if undo and ContentTools.Tools.Undo.canApply(null, null)
Expand Down Expand Up @@ -554,4 +557,4 @@ class ContentTools.ToolUI extends ContentTools.AnchoredComponentUI

# Reset the mouse down flag
@_mouseDown = false
@removeCSSClass('ct-tool--down')
@removeCSSClass('ct-tool--down')
2 changes: 1 addition & 1 deletion src/spec/ui/toolbox.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -315,4 +315,4 @@ describe 'ContentTools.ToolboxUI', () ->
# Check the tool is enabled after an update if an element is
# provided.
tool.update(element)
expect(tool.disabled()).toBe false
expect(tool.disabled()).toBe false

0 comments on commit 5a8fe95

Please sign in to comment.