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

Avoid duplicate entries in menu #7

Open
marcocarnazzo opened this issue Jun 18, 2014 · 1 comment
Open

Avoid duplicate entries in menu #7

marcocarnazzo opened this issue Jun 18, 2014 · 1 comment

Comments

@marcocarnazzo
Copy link

If you have the same image for many smiley (i. e. ':)' and ':-)'), emoji-menu has duplicate entries.

To avoid this, I changed your code.
Here if you want to integrate this feature:

        var filenames = [];
        for (var key in options) {
            if (options.hasOwnProperty(key)) {
                var filename = options[key];
                var alreadyExists = ($.inArray(filename, filenames) > -1);
                if (!alreadyExists) {
                    filenames.push(filename);
                    html.push('<a href="javascript:void(0)" title="' + util.htmlEntities(key) + '">' + EmojiArea.createIcon(key) + '<span class="label">' + util.htmlEntities(key) + '</span></a>');
                }
            }
        }
@marcocarnazzo
Copy link
Author

Uh, just a note.
This makes sense only with another piece: I'm trying to implement also live rendering (issue #3 )

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