Minor tweaks to the dialog code.

This commit is contained in:
Dave Page 2015-01-28 17:56:13 +00:00
parent 65dc4320f1
commit 9d94848af4
2 changed files with 12 additions and 8 deletions

View File

@ -20,13 +20,11 @@ function about_show() {
setup:function() {
return {
buttons:[{ text: "OK", key: 27, className: "btn btn-primary" }],
focus: { element: 0 },
options: { modal: 0, overflow: false, resizable: true }
options: { modal: 0, resizable: true }
};
},
build:function() {
this.elements.body.style.minHeight = "450px";
this.elements.body.style.minWidth = "800px";
},
prepare:function() {
this.setContent(this.message);
@ -38,8 +36,7 @@ function about_show() {
var content = '';
$.get("{{ url_for('about.index') }}",
function(data) {
alertify.aboutDialog('About {{ config.APP_NAME }}', data);
alertify.aboutDialog('About {{ config.APP_NAME }}', data).resizeTo(800, 450);
}
);
}

View File

@ -46,9 +46,10 @@ function test_dialog() {
if (!alertify.myAlert) {
alertify.dialog('myAlert', function factory() {
return {
main:function(title, message) {
main:function(title, message, data) {
this.set('title', title);
this.message = message;
this.data = data;
},
setup:function() {
return {
@ -59,6 +60,9 @@ function test_dialog() {
},
prepare:function() {
this.setContent(this.message);
},
callback:function(closeEvent) {
alertify.alert('Close Event', 'You pressed: ' + closeEvent.button.text + ' on ' + this.data);
}
}
},
@ -66,5 +70,8 @@ function test_dialog() {
}
alertify.myAlert('Dialog Test',
'This is a test dialog from Alertify!');
'This is a test dialog from Alertify!', 'This is dialog 1');
alertify.myAlert('Dialog Test 2',
'This is another test dialog from Alertify!', 'This is dialog 2');
}