uikit icon indicating copy to clipboard operation
uikit copied to clipboard

How can I create alarm dialog with no cancel button?

Open lexer opened this issue 12 years ago • 8 comments

Should I make my own implementation like Confirmation dialog, or it is possible to reuse confirmation dialog for this purpose?

lexer avatar Apr 13 '12 03:04 lexer

hmmm yeah maybe, or use the notifications maybe?

tj avatar Apr 13 '12 03:04 tj

In our app we need to show modal window that will block user until he read the message and press "Ok"

lexer avatar Apr 13 '12 03:04 lexer

Another example. User should be blocked until he will receive response via push notification. If user don't want to wait he ca press single button "Cancel" and resume his work.

lexer avatar Apr 13 '12 03:04 lexer

May be it would be better to modify confirmation to show ok and cancel only if they are declared. This is how android Alerts are designed for example.

new ConfirmationDialog().ok("done") - this is alarm dialog with single ok button new ConfirmationDialog().cancel("reset") - this is alarm dialog with single cancel button.

However in this design it should be named smth like "AlarmDialog" that is more generic name.

Have you also thought about separate callbacks? .ok("done", function(){ });

lexer avatar Apr 13 '12 04:04 lexer

I mean "AlertDialog" not alarm. We will try to make a pull request today.

lexer avatar Apr 13 '12 04:04 lexer

yeah we could have an Alert and ui.alert(msg) with .modal() etc default. modals in generate are kinda bad UX but I can see in some cases if you have a critical issue that needs attention

tj avatar Apr 13 '12 04:04 tj

yep sure. modal should be optional.

lexer avatar Apr 13 '12 05:04 lexer

We have added pull request https://github.com/visionmedia/uikit/pull/42

lexer avatar Apr 13 '12 05:04 lexer