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

Add Reverse Option #317

Closed
wants to merge 4 commits into from
Closed

Conversation

MohammadYounes
Copy link
Contributor

Fixes #234

Using the prettify reverse method won't do the trick when working with from and to values.

It will require extra work to reverse inputs too, for example: Fixing to value should fix the upper bound and release the lower bound.

I approached this by reversing the UI only, which also makes it usable in a Right-to-Left layout with ease.

Not sure if this going to be merged or not! so I only reversed the HTML5 skin, other skins reversal should be straight forward!

TODO:

  • Reverse the remaining skins.
  • Test all cases, I might have missed something!

Thanks

@MohammadYounes
Copy link
Contributor Author

@IonDen Re-based to 2.1.2

@IonDen IonDen added the Feature request Request for a new functionality label Oct 13, 2015
@IonDen IonDen self-assigned this Oct 13, 2015
@IonDen
Copy link
Owner

IonDen commented Oct 13, 2015

Hello, thanks. I will check this on next weekend i think.

@@ -499,7 +509,7 @@

if (this.options.type === "single") {
this.$cache.cont.append(single_html);
this.$cache.edge = this.$cache.cont.find(".irs-bar-edge");
this.$cache.edge = this.$cache.cont.find(".irs-bar-edge").toggleClass('reverse', this.options.reverse);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please separate this from caching items.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it okay to separate into a different line ?

this.$cache.edge.toggleClass('reverse', this.options.reverse);

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. But move it out of this code block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will duplicate the check, since it's only required in case of single slider

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. Abstraction is always better.

@IonDen
Copy link
Owner

IonDen commented Oct 13, 2015

@MohammadYounes please check comments to code.

@MohammadYounes
Copy link
Contributor Author

@IonDen all updated! I hope I didn't miss anything :)

@IonDen
Copy link
Owner

IonDen commented Oct 13, 2015

@MohammadYounes, also please create several demos here http://jsfiddle.net/IonDen/09u17wg7/ (change original file with yours). To check if everything is ok.

The gap only appears on certain screen sizes
@MohammadYounes
Copy link
Contributor Author

@IonDen some demos as requested http://jsfiddle.net/gajt6a51/1/

@IonDen
Copy link
Owner

IonDen commented Oct 13, 2015

@MohammadYounes, very good. Tnx. I will try to do final review on weekend.

@IonDen IonDen added the High priority Do it first label Nov 9, 2015
@mrjonny2
Copy link

mrjonny2 commented Dec 3, 2015

Please merge this.

@IonDen
Copy link
Owner

IonDen commented Dec 3, 2015

Hi guys, i'm in the middle of moving process and can't merge this right now. But if you really need reverse, you can use this pattern: http://jsfiddle.net/IonDen/wawgd9w2/
@mrjonny2, check this.

@mrjonny2
Copy link

mrjonny2 commented Dec 6, 2015

@IonDen
I can't seem to get this working with negative values as my slider needs to go from -30 to 70.
Example is here
http://jsfiddle.net/mrjonny2/9x9mt9zu/

@MohammadYounes
Copy link
Contributor Author

@mrjonny2 for this specific case, just add min http://jsfiddle.net/9x9mt9zu/1/

@IonDen
Copy link
Owner

IonDen commented Dec 6, 2015

@mrjonny2, for negative values it is a little bit tricky.
I have updated the example for you: http://jsfiddle.net/IonDen/gbmszmp4/

@mrjonny2
Copy link

mrjonny2 commented Dec 6, 2015

Thank you!!

@IonDen
Copy link
Owner

IonDen commented Oct 12, 2016

Will be available in 3.0

@IonDen IonDen closed this Oct 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Request for a new functionality High priority Do it first
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Reversed Option
3 participants