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

Cancel and OK buttons are the wrong way around #41

Closed
WilliamBZA opened this issue Dec 5, 2012 · 10 comments
Closed

Cancel and OK buttons are the wrong way around #41

WilliamBZA opened this issue Dec 5, 2012 · 10 comments

Comments

@WilliamBZA
Copy link

Standard in OSs seems to be OK on the left, Cancel on the right. alertify.js has it the other way around.

@hpshelton
Copy link

This is dependent on the OS. Mac OS X uses primary action (confirm) on the right, secondary action (cancel) on the left. Windows does the opposite. The library should presumably match the OS it's running on.

@fabien-d
Copy link
Owner

I agree this could be a nice feature since it would mimic the native dialogs - but from a user experience, I'd rather have consistency. The goal is to mimic the native dialogs as much as possible, but also aim to improve the user experience where possible.

I'll leave open for discussion - and see where this goes.

@thers
Copy link

thers commented Dec 16, 2012

I bet the agree or ok button always should be on the right side
and disagree or cancel on the left side, because, as i think, right side always represents "+" and left side "-" so if we okay with somewhat we are making plus to it mentally.

@stuartkeith
Copy link
Contributor

Perhaps it could be configurable? Keeping the existing behaviour by default, so it doesn't break anything.

Then the developer can easily:

  • Not worry about it, and use the default;
  • Choose the order that they feel is appropriate for their project (they might be developing a site used mostly by Windows users and feel primary/secondary is the right choice);
  • Write code that inspects the browser's user agent and selects the appropriate order;
  • Allow the user to choose the order and save it as a preference.

I don't know if putting the user agent code into Alertify itself is a good idea (sniffing the user agent is opening a can of worms), but I don't see any downsides in a simple "reverse button order" boolean (or however you'd go about it).

@fabien-d
Copy link
Owner

I'm not opposed to the reverse option. It could be part of the set method.
e.g. alertify.set({ buttonReverse: true });

or even more specific
alertify.set({ buttonOrder: 'win' });, alertify.set({ buttonOrder: 'mac' });

Something along those lines. I'm opposed to adding the user agent sniffing code in alertify...

@thers
Copy link

thers commented Dec 18, 2012

@fabien-d i think buttonReverse: true would be enough.

@stuartkeith
Copy link
Contributor

Yeah, I think buttonReverse is enough. It makes it clear what it does and you're not tying the behaviour to any particular OS.

@stuartkeith
Copy link
Contributor

@fabien-d
Copy link
Owner

@stuartkeith looks good. I left a comment on 1 line... but if you want to open a PR for it, I'll merge

@fabien-d
Copy link
Owner

Closed with ^ pull request. Will be part of release 0.3.1.

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

5 participants