From 20f6730c26104e4f24fc90e43882ff1cf71491da Mon Sep 17 00:00:00 2001 From: Umar Date: Wed, 25 Nov 2020 16:45:08 +0500 Subject: [PATCH 1/2] added option to handle show or hide checkOptions under link popup --- src/lib/EditorToolbar.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/EditorToolbar.js b/src/lib/EditorToolbar.js index e6189943..c8c44571 100644 --- a/src/lib/EditorToolbar.js +++ b/src/lib/EditorToolbar.js @@ -232,6 +232,7 @@ export default class EditorToolbar extends Component { let removeLinkConfig = config.removeLink || {}; let linkLabel = linkConfig.label || 'Link'; let removeLinkLabel = removeLinkConfig.label || 'Remove Link'; + let linkShowCheckOptions = linkConfig.showCheckOptions || true; let targetBlank = (entity && isCursorOnLink) ? entity.getData().target === '_blank' : false; let noFollow = (entity && isCursorOnLink) ? entity.getData().rel === 'nofollow' : false; @@ -245,7 +246,7 @@ export default class EditorToolbar extends Component { onTogglePopover={this._toggleShowLinkInput} defaultValue={defaultValue} onSubmit={this._setLink} - checkOptions={{ + checkOptions={linkShowCheckOptions && { targetBlank: {label: 'Open link in new tab', defaultValue: targetBlank}, noFollow: {label: 'No follow', defaultValue: noFollow}, }} From e8fe5708c0b81eddce410bfd6f76d49603fbe55e Mon Sep 17 00:00:00 2001 From: Umar Date: Wed, 25 Nov 2020 18:57:15 +0500 Subject: [PATCH 2/2] replaced showCheckOptions with hideCheckOptions --- src/lib/EditorToolbar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/EditorToolbar.js b/src/lib/EditorToolbar.js index c8c44571..859742dc 100644 --- a/src/lib/EditorToolbar.js +++ b/src/lib/EditorToolbar.js @@ -232,7 +232,7 @@ export default class EditorToolbar extends Component { let removeLinkConfig = config.removeLink || {}; let linkLabel = linkConfig.label || 'Link'; let removeLinkLabel = removeLinkConfig.label || 'Remove Link'; - let linkShowCheckOptions = linkConfig.showCheckOptions || true; + let linkHideCheckOptions = linkConfig.hideCheckOptions || false; let targetBlank = (entity && isCursorOnLink) ? entity.getData().target === '_blank' : false; let noFollow = (entity && isCursorOnLink) ? entity.getData().rel === 'nofollow' : false; @@ -246,7 +246,7 @@ export default class EditorToolbar extends Component { onTogglePopover={this._toggleShowLinkInput} defaultValue={defaultValue} onSubmit={this._setLink} - checkOptions={linkShowCheckOptions && { + checkOptions={!linkHideCheckOptions && { targetBlank: {label: 'Open link in new tab', defaultValue: targetBlank}, noFollow: {label: 'No follow', defaultValue: noFollow}, }}