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

Custom inlinestyle plugin utilizing module.inline.format or module.inline.toggle not working #58

Closed
davist11 opened this issue Jun 5, 2018 · 7 comments
Assignees

Comments

@davist11
Copy link

davist11 commented Jun 5, 2018

I took your advice from #38 and copied the inlinestyle.js plugin over to my config/redactor folder.

Basically, I'm trying to toggle a class on a link, so I adjusted the code in the plugin to be

this.styles = {
	"button": {
		title: "Button",
		args: {
			tag: 'a',
			class: 'button',
			type: 'toggle'
		}
	},
	"button_hollow": {
		title: "Button - Hollow",
		args: {
			tag: 'a',
			class: 'button -hollow',
			type: 'toggle'
		}
	}
};

That doesn't really work because it inserts an extra link even when you have a link selected. So I modified the code to use the module.inline.toggle API method, and even grabbed the example args, but none of those attributes were added after applying the style. Since we technically haven't purchased Redactor, I couldn't submit the issue directly to them.

@davist11
Copy link
Author

davist11 commented Jul 3, 2018

This conversation better describes what is going on: #38 (comment)

Is this something that should get submitted to Redactor itself?

@andris-sevcenko andris-sevcenko self-assigned this Jul 13, 2018
@andris-sevcenko
Copy link
Contributor

Is this still an issue if you download the latest redactor version from the Redactor site and replace the redactor.js files in the plugin? There's been an update recently and there's a chance this might have been fixed.

@davist11
Copy link
Author

Can I download Redactor directly from their site without a license?

@andris-sevcenko
Copy link
Contributor

Ah, probably not. I'll look into this. Can you send over the custom plugin you're using to support@craftcms.com and reference this issue?

@davist11
Copy link
Author

File sent

@andris-sevcenko
Copy link
Contributor

I've just passed this onwards to Imperavi. They're not the most communicative bunch, so let's wait and hope they resolve it. If in the meantime, you come up with a patch that makes this work as you need it to work, feel free to forward a patch and we can add that to https://github.com/craftcms/redactor/blob/v2/src/assets/field/dist/js/RedactorOverrides.js

@andris-sevcenko
Copy link
Contributor

@davist11 this should be fixed with the next Redactor update.

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

2 participants