From 67032863fd88d5723ccfc9f41716d7d9caf0f1a6 Mon Sep 17 00:00:00 2001 From: Sergio Estevao Date: Sat, 24 Jun 2017 18:31:03 +0100 Subject: [PATCH] Make sure the toolbar is extended when going to HTML mode. --- Aztec/Classes/GUI/FormatBar/FormatBar.swift | 4 ++++ Example/Example/EditorDemoController.swift | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Aztec/Classes/GUI/FormatBar/FormatBar.swift b/Aztec/Classes/GUI/FormatBar/FormatBar.swift index 27f2054aa..8e4ebd3de 100644 --- a/Aztec/Classes/GUI/FormatBar/FormatBar.swift +++ b/Aztec/Classes/GUI/FormatBar/FormatBar.swift @@ -311,6 +311,10 @@ open class FormatBar: UIView { @IBAction func handleToggleButtonAction(_ sender: FormatBarItem) { let shouldExpand = overflowItemsHidden + overflowToolbar(expand: shouldExpand) + } + + open func overflowToolbar(expand shouldExpand: Bool) { setOverflowItemsVisible(shouldExpand) let direction: OverflowToggleAnimationDirection = shouldExpand ? .vertical : .horizontal diff --git a/Example/Example/EditorDemoController.swift b/Example/Example/EditorDemoController.swift index e47a69a22..8e6ff7fc8 100644 --- a/Example/Example/EditorDemoController.swift +++ b/Example/Example/EditorDemoController.swift @@ -346,6 +346,7 @@ class EditorDemoController: UIViewController { // MARK: - Helpers @IBAction func toggleEditingMode() { + formatBar.overflowToolbar(expand: true) editingMode.toggle() } @@ -415,7 +416,7 @@ class EditorDemoController: UIViewController { if richTextView.isFirstResponder { return [ UIKeyCommand(input:"B", modifierFlags: .command, action:#selector(toggleBold), discoverabilityTitle:NSLocalizedString("Bold", comment: "Discoverability title for bold formatting keyboard shortcut.")), UIKeyCommand(input:"I", modifierFlags: .command, action:#selector(toggleItalic), discoverabilityTitle:NSLocalizedString("Italic", comment: "Discoverability title for italic formatting keyboard shortcut.")), - UIKeyCommand(input:"D", modifierFlags: [.command, .alternate], action:#selector(toggleStrikethrough), discoverabilityTitle: NSLocalizedString("Strikethrough", comment:"Discoverability title for strikethrough formatting keyboard shortcut.")), + UIKeyCommand(input:"S", modifierFlags: [.command], action:#selector(toggleStrikethrough), discoverabilityTitle: NSLocalizedString("Strikethrough", comment:"Discoverability title for strikethrough formatting keyboard shortcut.")), UIKeyCommand(input:"U", modifierFlags: .command, action:#selector(EditorDemoController.toggleUnderline(_:)), discoverabilityTitle: NSLocalizedString("Underline", comment:"Discoverability title for underline formatting keyboard shortcut.")), UIKeyCommand(input:"Q", modifierFlags:[.command,.alternate], action: #selector(toggleBlockquote), discoverabilityTitle: NSLocalizedString("Block Quote", comment: "Discoverability title for block quote keyboard shortcut.")), UIKeyCommand(input:"K", modifierFlags:.command, action:#selector(toggleLink), discoverabilityTitle: NSLocalizedString("Insert Link", comment: "Discoverability title for insert link keyboard shortcut.")),