Skip to content

Commit

Permalink
alert can be implement in terms of confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
jlong committed Apr 3, 2011
1 parent 783f3b6 commit 17e5e43
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions javascripts/popup.js
Expand Up @@ -333,22 +333,6 @@ Popup.dialog = function(options) {
popup.show();
}

Popup.alert = function(message, options) {
options = Object.extend({
title: 'Alert',
message: message,
width: '20em',
buttons: [Popup.Okay],
okay: function() { }
}, options)

options.buttonClick = options.buttonClick || function(button) {
if (button == Popup.Okay) options.okay();
}

Popup.dialog(options)
}

Popup.confirm = function(message, options) {
options = Object.extend({
title: 'Confirm',
Expand All @@ -367,6 +351,16 @@ Popup.confirm = function(message, options) {
Popup.dialog(options);
}

Popup.alert = function(message, options) {
options = Object.extend({
title: 'Alert',
message: message,
buttons: [Popup.Okay]
}, options)

Popup.confirm(message, options)
}

// Element extensions
Element.addMethods({
closePopup: function(element) {
Expand Down

0 comments on commit 17e5e43

Please sign in to comment.