Skip to content

Commit

Permalink
Add checking of "showTargetSelector" to the render phase of ButtonLin…
Browse files Browse the repository at this point in the history
…kEdit component

Fixes liferay#608
  • Loading branch information
zsagia authored and azotova committed Jan 7, 2017
1 parent 187b8ad commit a26d5d1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ui/react/src/components/buttons/button-link-edit.jsx
Expand Up @@ -200,13 +200,19 @@
autocompleteDropdown = <AlloyEditor.ButtonLinkAutocompleteList {...autocompleteDropdownProps} />;
}

var targetButtonEdit;

if (this.props.showTargetSelector) {
targetButtonEdit = <AlloyEditor.ButtonLinkTargetEdit {...targetSelector} />;
}

return (
<div className="ae-container-edit-link">
<button aria-label={AlloyEditor.Strings.removeLink} className="ae-button" disabled={!this.state.element} onClick={this._removeLink} title={AlloyEditor.Strings.remove}>
<span className="ae-icon-unlink"></span>
</button>
<div className="ae-container-input xxl">
<AlloyEditor.ButtonLinkTargetEdit {...targetSelector} />
{targetButtonEdit}
<div className="ae-container-input flexible">
<input className="ae-input" onChange={this._handleLinkHrefChange} onKeyDown={this._handleKeyDown} placeholder={AlloyEditor.Strings.editLink} ref="linkInput" type="text" value={this.state.linkHref}></input>
{autocompleteDropdown}
Expand Down

0 comments on commit a26d5d1

Please sign in to comment.