summaryrefslogtreecommitdiff
path: root/statistics.php
diff options
context:
space:
mode:
authorŁukasz Wilenski <wooc@gazeta.pl>2012-03-27 17:12:28 +0000
committerŁukasz Wilenski <wooc@gazeta.pl>2012-03-27 17:12:28 +0000
commit2283835e60955bbef9bdd17268db704022ca9dad (patch)
treee28605b4df08506145081353448a28cda877a2dc /statistics.php
parent2416f49460f4cfe1264b153553357a91837db641 (diff)
downloadwebtrees-2283835e60955bbef9bdd17268db704022ca9dad.tar.gz
webtrees-2283835e60955bbef9bdd17268db704022ca9dad.tar.bz2
webtrees-2283835e60955bbef9bdd17268db704022ca9dad.zip
use modal dialog for own statistics charts
Diffstat (limited to 'statistics.php')
-rw-r--r--statistics.php25
1 files changed, 20 insertions, 5 deletions
diff --git a/statistics.php b/statistics.php
index dd7eb55363..d9a49a7dad 100644
--- a/statistics.php
+++ b/statistics.php
@@ -449,14 +449,29 @@ if (!$ajax) {
box.style.display = 'none';
}
}
- function openPopup() {
- window.open('', '_popup', 'top=50, left=50, width=950, height=480, scrollbars=0, scrollable=0');
- return true;
+ function statsModalDialog(url, title) {
+ var $form = jQuery('#own-stats-form');
+ jQuery.post($form.attr('action'), $form.serialize(), function(response) {
+ jQuery('div#statistics-plot').html(response);
+ });
+ dialog=jQuery('<div title="'+title+'"></div>')
+ .load(url)
+ .dialog({
+ modal: true,
+ width: 962,
+ position: ['center',50],
+ close: function(event, ui) { $(this).remove(); }
+ });
+ // Close the window when we click outside it.
+ jQuery(".ui-widget-overlay").live("click", function () {
+ jQuery("div:ui-dialog:visible").dialog("close");
+ });
+ return false;
}
//-->
</script>
<?php
- echo '<form method="post" name="form" action="statisticsplot.php?action=newform" target="_popup" onsubmit="return openPopup()">';
+ echo '<div id="own-stats"><form method="post" id="own-stats-form" name="form" action="statisticsplot.php" onsubmit="statsModalDialog(\'statisticsplot.php?action=newform\', \'', WT_I18N::translate('Statistics plot'), '\'); return false;">';
echo '<input type="hidden" name="action" value="update">';
echo '<table width="100%">';
if (!isset($plottype)) $plottype = 11;
@@ -656,7 +671,7 @@ if (!$ajax) {
</td>
</tr>
</table>
- </form>
+ </form></div>
</fieldset>';
}
}