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

Onclick button delimiter not registered #51

Closed
Flatlinezor opened this issue Jan 12, 2017 · 9 comments
Closed

Onclick button delimiter not registered #51

Flatlinezor opened this issue Jan 12, 2017 · 9 comments

Comments

@Flatlinezor
Copy link

Hello!

Is there a way to get the delimiter registered via a button click?

@ does not seem to trigger mentions although if I were to manually enter it, it works like charm.

onclick: function () {

					tinymce.activeEditor.execCommand('mceInsertContent', false, "@");
								}
					});
@StevenDevooght
Copy link
Owner

I don't really understand the question. You want to get the configured delimiter from the mention plugin?

@Flatlinezor
Copy link
Author

Flatlinezor commented Jan 13, 2017 via email

@StevenDevooght
Copy link
Owner

Ah, ok

Indeed that functionality is not build in at the moment. I think it should be possible to trigger a keyup event in the button click handler. This should trigger the plugin. Of course it would be nice if we could put this behavior in the plugin itself.

@Flatlinezor
Copy link
Author

Flatlinezor commented Jan 13, 2017 via email

@StevenDevooght
Copy link
Owner

What you can do in your button callback is fire the keyup events instead of calling the insertContent command.

See example here.

You can find the keycodes for your delimiters here.

@Flatlinezor
Copy link
Author

Flatlinezor commented Jan 15, 2017

Thanks for the help. Eventually I will need to use something that guarantees me that the delimiters will be placed in the proper editor (since I will have multiple editors on my page because all the text that I am allowing to be edited are presented as section per section.)

Your example lines will be a good addon for the full plugin since the test one you use is considerably smaller than your full fledged plugin.

And I get the editor.fire "fire" event undefined unfortunately :( (Sorry to suck :D )

@Flatlinezor
Copy link
Author

Well yes I suck, could not do it after all :) Will wait I guess until it might get implemented ^_^

@taskeenhaiderbaloch
Copy link

@StevenDevooght man its not workingin my case in angular4

@taskeenhaiderbaloch
Copy link

please help me i have same issue and i m trying it from previous 4 days and i have nothing to write in my jira story for time logging 😢

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

3 participants