Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown Button in Toolbar angular. #1634

Open
subhendumondal opened this issue May 31, 2019 · 0 comments
Open

Dropdown Button in Toolbar angular. #1634

subhendumondal opened this issue May 31, 2019 · 0 comments

Comments

@subhendumondal
Copy link

Hi, I have facing hard time to figure out the problem and fixing the issue. I have tried to add dropdown menu in toolbar using angularjs/material. please check the code below,

$provide.decorator('taOptions', ['taRegisterTool', '$delegate', function (taRegisterTool, taOptions) {
	
	//token select box
    taRegisterTool('tokens', {
        buttontext: '[tokens]',
        action: function (event, val, taRegisterTool, taOptions) {


            if(typeof val === 'string') {
                this.$editor().wrapSelection('insertText', '[ ' + val + ' ]', true);
            }
            
            return;
        },
        activestate: function() {
            console.log('called');
        }
    });


    taOptions.toolbar = [
        ['h1', 'h2', 'h3'],
        ['bold', 'italics', 'underline', 'html'],
        ['insertImage', 'insertLink', ],
        ['tokens']
    ];
    taOptions.classes = {
        toolbarGroup: 'ta-button-group',
        toolbarButton: '',
        textEditor: 'ta-text-editor',
        htmlEditor: 'md-input'
    };
    return taOptions;

}];

$provide.decorator('taTools', ['$delegate', function (taTools) {

        taTools.tokens.display = `
            <md-select class="editor-select" ng-model="valueModel" ng-change="action($event, valueModel)" placeholder="Add Tokens">
                <md-option ng-value="opt" ng-repeat="opt in ['email', 'number']">[ {{ opt }} ]</md-option>
            </md-select>
        `;
            
}]);

Error:

image

and every time click on the selectbox editor getting disabled. how can I keep it editor mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant