Skip to content

Commit

Permalink
Merge pull request #1943 from wordpress-mobile/issue/remove_block_model
Browse files Browse the repository at this point in the history
Remove BlockModel var and prop.
  • Loading branch information
SergioEstevao authored Feb 25, 2020
2 parents d1a9166 + 8e8f8be commit d9f865c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 82 deletions.
15 changes: 0 additions & 15 deletions react-native-aztec/ios/RNTAztecView/BlockFormatHandler.swift

This file was deleted.

3 changes: 0 additions & 3 deletions react-native-aztec/ios/RNTAztecView/BlockModel.swift

This file was deleted.

This file was deleted.

26 changes: 3 additions & 23 deletions react-native-aztec/ios/RNTAztecView/RCTAztecView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ class RCTAztecView: Aztec.TextView {
@objc var onSelectionChange: RCTBubblingEventBlock? = nil
@objc var minWidth: CGFloat = 0
@objc var maxWidth: CGFloat = 0
@objc var blockType: NSDictionary? = nil {
didSet {
guard let block = blockType, let tag = block["tag"] as? String else {
return
}
blockModel = BlockModel(tag: tag)
}
}

@objc var activeFormats: NSSet? = nil {
didSet {
let currentTypingAttributes = formattingIdentifiersForTypingAttributes()
Expand All @@ -46,13 +39,7 @@ class RCTAztecView: Aztec.TextView {
get {
return super.textAlignment
}
}

var blockModel = BlockModel(tag: "") {
didSet {
forceTypingAttributesIfNeeded()
}
}
}

private var previousContentSize: CGSize = .zero

Expand Down Expand Up @@ -618,12 +605,6 @@ class RCTAztecView: Aztec.TextView {
}
}

func forceTypingAttributesIfNeeded() {
if let formatHandler = HeadingBlockFormatHandler(block: blockModel) {
formatHandler.forceTypingFormat(on: self)
}
}

// MARK: - Event Propagation

func propagateContentChanges() {
Expand Down Expand Up @@ -672,8 +653,7 @@ extension RCTAztecView: UITextViewDelegate {
guard isInsertingDictationResult == false else {
return
}

forceTypingAttributesIfNeeded()

propagateContentChanges()
updatePlaceholderVisibility()
//Necessary to send height information to JS after pasting text.
Expand Down
1 change: 0 additions & 1 deletion react-native-aztec/ios/RNTAztecView/RCTAztecViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ @interface RCT_EXTERN_MODULE(RCTAztecViewManager, NSObject)
RCT_EXPORT_VIEW_PROPERTY(onBlur, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onPaste, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onSelectionChange, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(blockType, NSDictionary)
RCT_EXPORT_VIEW_PROPERTY(activeFormats, NSSet)

RCT_EXPORT_VIEW_PROPERTY(onActiveFormatsChange, RCTBubblingEventBlock)
Expand Down

0 comments on commit d9f865c

Please sign in to comment.