Git Product home page Git Product logo

Comments (10)

hpshelton avatar hpshelton commented on May 28, 2024

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.

from alertify.js.

fabien-d avatar fabien-d commented on May 28, 2024

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.

from alertify.js.

thers avatar thers commented on May 28, 2024

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.

from alertify.js.

stuartkeith avatar stuartkeith commented on May 28, 2024

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).

from alertify.js.

fabien-d avatar fabien-d commented on May 28, 2024

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...

from alertify.js.

thers avatar thers commented on May 28, 2024

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

from alertify.js.

stuartkeith avatar stuartkeith commented on May 28, 2024

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

from alertify.js.

stuartkeith avatar stuartkeith commented on May 28, 2024

I quickly tried it out here: https://github.com/stuartkeith/alertify.js/commit/c8bdc0f4cb1272a7e538c0975414bb0c448ccae9

from alertify.js.

fabien-d avatar fabien-d commented on May 28, 2024

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

from alertify.js.

fabien-d avatar fabien-d commented on May 28, 2024

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

from alertify.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.