Commit 0e3324e2 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1471357: Fixing jQuery dialog in webservcies serviceconfig page



Turning it into a modal and fixing up table thead alignment

Change-Id: I71756dcfb45387c1660ad102c5d4d0e7206eaf75
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent aeffa968
{if !$dialog}
{include file='header.tpl'}
{/if}
<h2>{str tag="function" section="auth.webservice"}: {$function->name} </h2>
<table>
......@@ -106,5 +108,6 @@
<br/>
{$form|safe}
{include file='footer.tpl'}
\ No newline at end of file
{if !$dialog}
{include file='footer.tpl'}
{/if}
\ No newline at end of file
......@@ -136,6 +136,7 @@ $form = array(
'renderer' => 'div',
'type' => 'div',
'id' => 'maintable',
'elementclasses' => false,
'elements' => $elements,
'jsform' => false,
);
......@@ -146,35 +147,18 @@ $form['successcallback'] = 'serviceconfig_submit';
$form = pieform($form);
$inlinejs = <<<EOF
<script type="application/javascript">
jQuery(function() {
jQuery(".dialogue").click(function(e) {
jQuery(function($) {
$(".dialogue").click(function(e) {
e.preventDefault();
e.stopPropagation();
// fetch the info for the method
jQuery.ajax({
$.ajax({
url: e.currentTarget.href + '&dialog=1',
}).done(function(data) {
// make sure we have a #dialog div
if (jQuery("#dialog").length == 0) {
jQuery("body").append("<div id='dialog' style='display:none'></div>");
}
// close any open dialogs
jQuery(".ui-dialog-content").dialog("close");
jQuery("#dialog").html(data).dialog({
title: get_string('wsdoc', 'auth.webservice'),
open: function(event, ui) {
// move the focus to the top of the dialog box
jQuery("html, body").animate({
scrollTop: jQuery(".ui-dialog-titlebar").offset().top
}, 500)
},
width: '90%',
buttons: [{
text: get_string('Close', 'mahara'),
click: function() {
jQuery(this).dialog("close");
}
}]
});
$(".js-page-modal .modal-body").html(data).css("max-height", "80vh");
$(".js-page-modal .modal-dialog").css("width", "80vw");
$(".js-page-modal").modal('show');
});
});
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment