Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import AlloyEditor from 'alloyeditor';
export default class EzBtnLink extends AlloyEditor.ButtonLink {
static get key() {
return 'ezlink';
}
/**
* Lifecycle. Renders the UI of the button.
*
* @method render
* @return {Object} The content which should be rendered.
*/
render() {
const cssClass = 'ae-button ez-btn-ae ' + this.getStateClasses();
if (this.props.renderExclusive) {
const props = this.mergeButtonCfgProps();
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import AlloyEditor from 'alloyeditor';
export default class EzBtnImageLink extends AlloyEditor.ButtonLink {
constructor(props) {
super(props);
this.requestExclusive = this.requestExclusive.bind(this);
}
static get key() {
return 'ezimagelink';
}
getWidget() {
const editor = this.props.editor.get('nativeEditor');
const wrapper = editor.getSelection().getStartElement();
return editor.widgets.getByElement(wrapper);
}