jquery.customSelect icon indicating copy to clipboard operation
jquery.customSelect copied to clipboard

Added callbacks and new iconClass parameter.

Open objectivehtml opened this issue 12 years ago • 3 comments

  • Added two new callbacks, init() & changed()
  • Added new option "iconClass", which will add another nested span tag with the defined classname. This makes working with icon fonts easier (like Font Awesome).

objectivehtml avatar Jul 18 '13 00:07 objectivehtml

@objectivehtml I'm curious what the preferred method would be to populate the icon into the new span? Do you just use :before ? And if so, why do you need an addition span to do so?

adamcoulombe avatar Aug 08 '13 14:08 adamcoulombe

I have all this working already. I need to recommit my changes so you can see all the stuff I did. I made a pull request, and then decided to refactor my work a bit. I think with these new callback methods and new params for the icon node, it works great.

I use Font Awesome for my icons. So I typically do something like this:

<i class="icon-search"></i>

or

<span class="icon-search"></span>

So with your plugin, I just added a param to append a new icon node and I could apply any class to it. I bet there were other ways to do it, but this was easiest/quickest for me to implement.

objectivehtml avatar Aug 08 '13 15:08 objectivehtml

I just pushed my latest changes.

Here is a basic usage example:

(function($) {
    $(document).ready(function() {
        $('.custom-select').customSelect({
            iconClass: 'icon-sort-down'
        });
    });
}(jQuery));

objectivehtml avatar Aug 08 '13 15:08 objectivehtml