app/assets/javascripts/jqr-helpers.js in jqr-helpers-1.0.15 vs app/assets/javascripts/jqr-helpers.js in jqr-helpers-1.0.16
- old
+ new
@@ -25,11 +25,11 @@
function ujsDialogOpen() {
if ($(this).parent().height() > $(window).height()) {
$(this).height($(window).height() * 0.8);
$(this).parent().css('top',
- ($(window).height() - $(this).parent().height()) / 2
+ Math.max(($(window).height() - $(this).parent().height()) / 2, 1)
);
$(this).css('overflow-y', 'auto');
}
var x = $(this).find('.ujs-dialog-x');
if (x.length) {
@@ -81,9 +81,12 @@
else if (element == 'close') {
dialogOptions.buttons[index] = ujsDialogClose;
}
else if (element.click == 'close') {
dialogOptions.buttons[index].click = ujsDialogClose;
+ }
+ else {
+ dialogOptions.buttons[index] = eval(element);
}
});
}
if (url) {
$(this).trigger('jqr.beforedialogopen');