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

suggestion: Making an icon editable #54

Open
bbfriend opened this issue Jun 5, 2017 · 1 comment
Open

suggestion: Making an icon editable #54

bbfriend opened this issue Jun 5, 2017 · 1 comment

Comments

@bbfriend
Copy link
Contributor

bbfriend commented Jun 5, 2017

Now(v2.0.9)

            var content = '<span class="fa fa-' + id + '"></span>';

            if (editor.selection.getNode().textContent === '') {
                content += '&nbsp;';
            }

to (use HTML tag i or em )

//            var content = '<span class="fa fa-' + id + '"></span>';

//            if (editor.selection.getNode().textContent === '') {
//                content += '&nbsp;';
//            }

            var content = '&nbsp;<i class="fa fa-' + id + '"><span style="color: transparent; display: none;">' + id + '</span></i>&nbsp;';

and ,Delate Line (tinymce.init)

noneditable_noneditable_class: 'fa',

Editors can change the size ,color, and add links.
It will add extra characters, It is not perfect, but is this fine?
I referred to WP Visual Icon Fonts

@josh18
Copy link
Owner

josh18 commented Jun 13, 2017

I think the issue with this is that you can type characters into it, like <span class="fa fa-flag">Text in here</span> which doesn't work.

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