Comments (10)
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.
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.
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.
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.
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.
@fabien-d i think buttonReverse: true
would be enough.
from alertify.js.
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.
I quickly tried it out here: https://github.com/stuartkeith/alertify.js/commit/c8bdc0f4cb1272a7e538c0975414bb0c448ccae9
from alertify.js.
@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.
Closed with ^ pull request. Will be part of release 0.3.1.
from alertify.js.
Related Issues (20)
- Can you add timeout function for confirmation and alert too? HOT 1
- Button focus error.
- Change Button Colour Dynamically / Multiple Buttons HOT 1
- Add main file in package.json HOT 1
- Since alertify is no longer maintained, consider jAlert HOT 9
- Alertify confirms and submits a form automatically without clicking OK. HOT 1
- can i use alertify in react HOT 2
- Prevent Duplicates HOT 2
- Notifications in background
- Missing default bootstrap skin without theme
- Does it supports on IE9 and below HOT 1
- How to enable alert and prompt at same time
- not working with firefox HOT 3
- How can I add an checkbox to promt and catch result? HOT 1
- issue with alertify I want display outside the iframe onClicking button
- how can i change the date formatting by using jqury
- Confirm popup not wotking for mobile device
- a href tag
- prevent close on enter
- Alertify Confirm Automatically Refresh Page HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alertify.js.