Files
Gary Sharp c846fa053a Dialog height reduced & remove js minify maps
Provide better support for lower resolution devices (buttons became
hidden in tall dialogs). Remove references to JavaScript minification
source maps which aren't deployed and caused confusion.
2014-09-08 14:51:51 +10:00

62 lines
2.0 KiB
JavaScript

(function ($, window, document) {
$(function () {
var createJobDialog = null;
var dialogMethods = {
close: function () {
createJobDialog.dialog('close');
},
setButtons: function (buttons) {
if (createJobDialog)
createJobDialog.dialog('option', 'buttons', buttons);
}
}
if (!document.DiscoFunctions) {
document.DiscoFunctions = {};
}
document.DiscoFunctions.CreateOpenJobDialog = function (url) {
createJobDialog = $('<div>').attr('id', 'createJobDialog').css({ paddingTop: '0' }).appendTo(document.body);
createJobDialog.dialog({
resizable: false,
draggable: false,
modal: true,
autoOpen: false,
title: 'Create Job',
width: 850,
height: Math.min(670, $(window).height() - 50),
close: function () {
createJobDialog.find('iframe').attr('src', 'about:blank');
createJobDialog.dialog('destroy').remove();
createJobDialog = null;
},
buttons: {}
});
var iframe = $('<iframe>')
.attr({ 'src': url })
.css({
'border': 'none',
'height': '100%',
'width': '100%'
})
.appendTo(createJobDialog);
createJobDialog[0].discoDialogMethods = dialogMethods;
window.setTimeout(function () {
createJobDialog.dialog('open');
}, 1);
}
// Create Job Button
$('#buttonCreateJob').click(function () {
var $this = $(this);
var href = $this.attr('href');
document.DiscoFunctions.CreateOpenJobDialog(href);
return false;
});
})
})($, window, document);