Skip to content

Commit

Permalink
Call list button actions from view controller
Browse files Browse the repository at this point in the history
  • Loading branch information
tonisevener committed Dec 13, 2023
1 parent c061327 commit d114a8a
Showing 1 changed file with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,21 @@ extension WKSourceEditorViewController: WKEditorToolbarExpandingViewDelegate {
}

func toolbarExpandingViewDidTapUnorderedList(toolbarView: WKEditorToolbarExpandingView, isSelected: Bool) {

let action: WKSourceEditorFormatterButtonAction = isSelected ? .remove : .add
textFrameworkMediator.listFormatter?.toggleListBullet(action: action, in: textView)
}

func toolbarExpandingViewDidTapOrderedList(toolbarView: WKEditorToolbarExpandingView, isSelected: Bool) {

let action: WKSourceEditorFormatterButtonAction = isSelected ? .remove : .add
textFrameworkMediator.listFormatter?.toggleListNumber(action: action, in: textView)
}

func toolbarExpandingViewDidTapIncreaseIndent(toolbarView: WKEditorToolbarExpandingView) {

textFrameworkMediator.listFormatter?.tappedIncreaseIndent(currentSelectionState: selectionState(), textView: textView)
}

func toolbarExpandingViewDidTapDecreaseIndent(toolbarView: WKEditorToolbarExpandingView) {

textFrameworkMediator.listFormatter?.tappedDecreaseIndent(currentSelectionState: selectionState(), textView: textView)
}
}

Expand Down Expand Up @@ -377,19 +379,21 @@ extension WKSourceEditorViewController: WKEditorInputViewDelegate {
}

func didTapBulletList(isSelected: Bool) {

let action: WKSourceEditorFormatterButtonAction = isSelected ? .remove : .add
textFrameworkMediator.listFormatter?.toggleListBullet(action: action, in: textView)
}

func didTapNumberList(isSelected: Bool) {

let action: WKSourceEditorFormatterButtonAction = isSelected ? .remove : .add
textFrameworkMediator.listFormatter?.toggleListNumber(action: action, in: textView)
}

func didTapIncreaseIndent() {

textFrameworkMediator.listFormatter?.tappedIncreaseIndent(currentSelectionState: selectionState(), textView: textView)
}

func didTapDecreaseIndent() {

textFrameworkMediator.listFormatter?.tappedDecreaseIndent(currentSelectionState: selectionState(), textView: textView)
}

func didTapClose() {
Expand Down

0 comments on commit d114a8a

Please sign in to comment.