itsjavi / bootstrap-colorpicker

Bootstrap Colorpicker is a modular color picker plugin for Bootstrap.
https://itsjavi.com/bootstrap-colorpicker/
MIT License
1.38k stars 367 forks source link

Support for right-to-left type of languages #193

Closed polterguy closed 7 years ago

polterguy commented 7 years ago

Howdy, and thx for a brilliant colorpicker.

I have one request though, which is to create support for rtl languages. When I include bootstrap-rtl on my page (which is a theme for bootstrap supporting Arabic, Persian and Hebrew RTL languages, among other things), then the offset calculations for left/top of the dropdown becomes really "weird", to say the least ...

I think it should be easy to implement support for this, by checking the rtl attribute, or something, before you start calculating the dropdown's left/top positions.

The way to test this, would probably be to simply add up "dir='rtl'" as an attribute on e.g. your "body" HTML element, or something, and then include your colorpicker.

The colorpicker becomes ~1000px wide, and everything becomes scewed in its default implementation ...

Thx for a great lib,

.t

polterguy commented 7 years ago

Never mind, created an additional CSS file with the following code, which fixed the problem;

.colorpicker {
    right:inherit;
}
polterguy commented 7 years ago

Which I, btw, only include if we're in RTL mode ...