How to use the alloyeditor.ButtonLink function in alloyeditor

To help you get started, we’ve selected a few alloyeditor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ezsystems / ezplatform-admin-ui / src / bundle / Resources / public / js / alloyeditor / src / buttons / ez-btn-link.js View on Github external
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();
github ezsystems / ezplatform-admin-ui / src / bundle / Resources / public / js / alloyeditor / src / buttons / ez-btn-imagelink.js View on Github external
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);
    }