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

Request: issue event after colorPicker has been initialized #28

Closed
mbaierl opened this issue Mar 20, 2018 · 3 comments
Closed

Request: issue event after colorPicker has been initialized #28

mbaierl opened this issue Mar 20, 2018 · 3 comments
Assignees

Comments

@mbaierl
Copy link

mbaierl commented Mar 20, 2018

Right now a new iro.ColorPicker(...) immediately returns an object but finishes initialisation of the object after the document.readyState changed to "complete".

It would be amazing if there would be an event issued after the _init function finished doing its job and the colorPicker object is completely initialized.

For example the following at the end of the _init function:

_init: function _init(el, opts) {
    ...
    this.emit("initialized", this);
},

Thanks!

@jaames jaames self-assigned this Mar 20, 2018
@jaames
Copy link
Owner

jaames commented Mar 20, 2018

Thank you for the request! This would definitely be a helpful addition so I'll work on adding it ASAP :)

I think I'll probably call the event mount or something like that, to signify that the color picker has been mounted into the DOM

@mbaierl
Copy link
Author

mbaierl commented Mar 20, 2018

Thanks James!

@jaames
Copy link
Owner

jaames commented Mar 20, 2018

The mount event should be available now, thanks again @mbaierl!

Here's a usage example:

// create a new color picker instance
var example = new iro.ColorPicker(...);

example.on("mount", function() {
  // do something
});

In addition, the color object is now passed to the input:start and input:end events, which was requested a while ago in #24

Let me know if you have any other requests :)

@jaames jaames closed this as completed Mar 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants