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

How can i disable slider bar ? #33

Closed
josephNg95 opened this issue Apr 24, 2018 · 4 comments
Closed

How can i disable slider bar ? #33

josephNg95 opened this issue Apr 24, 2018 · 4 comments
Assignees

Comments

@josephNg95
Copy link

josephNg95 commented Apr 24, 2018

I hope you can help.
I tried with a stupid way: g[0].innerHTML = '' in before mount event.
Remove some element and it hidden but when I clicking on the white space (show it before) It still works as if nothing had happened.
p/s: same #13

@jaames jaames self-assigned this Apr 24, 2018
@jaames
Copy link
Owner

jaames commented Apr 24, 2018

A hacky workaround to this would be hiding the slider with CSS:

.iro__slider {
  display: none;
  visibility: hidden;
  pointer-events: none;
}

Then stop it from interacting with mouse clicks:

colorPicker.on("mount", function(){
  colorPicker.ui.splice(1, 1);
});

Custom UI layouts are being planned for 4.0, though! The discussion for that is here

@jaames jaames closed this as completed Apr 24, 2018
@josephNg95
Copy link
Author

Thanks for your support 😄 !

@jaames
Copy link
Owner

jaames commented Feb 22, 2019

iro.js version 4.0.0 is now live, which provides the ability to disable the brightness bar with the new custom layout option:

var colorPicker = new iro.ColorPicker('#color-picker', {
  layout: [
    {
      component: iro.ui.Wheel,
      options: {}
    }
  ]
});

--

Sorry for taking so long to find a good way to implement this!

@josephNg95
Copy link
Author

:) no problem. I fixed it with your solution above, and it's work!
~ 1 year =))

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