Hacked the PMA_generate_slider_effect() code to work with jQuery. Ajax

queries were failing due to the use of document.write(). Need to find a
better solution with $.append()
This commit is contained in:
ninadsp
2010-06-28 01:59:52 +05:30
parent e2cef4bc23
commit 9a4b524db7

View File

@@ -2551,10 +2551,16 @@ function PMA_generate_slider_effect($id, $message)
echo '<div id="' . $id . '">'; echo '<div id="' . $id . '">';
return; return;
} }
/**
* Bad hack on the next line. document.write() conflicts with jQuery, hence,
* opening the <div> with PHP itself instead of JavaScript.
*
* @todo find a better solution that uses $.append(), the recommended method
*/
?> ?>
<div id="<?php echo $id; ?>" <?php echo $GLOBALS['cfg']['InitialSlidersState'] == 'closed' ? ' style="display: none; overflow:auto;"' : ''; ?>>
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[
document.write('<div id="<?php echo $id; ?>" <?php echo $GLOBALS['cfg']['InitialSlidersState'] == 'closed' ? ' style="display: none; overflow:auto;"' : ''; ?>>');
function PMA_set_status_label_<?php echo $id; ?>() { function PMA_set_status_label_<?php echo $id; ?>() {
if ($('#<?php echo $id; ?>').css('display') == 'none') { if ($('#<?php echo $id; ?>').css('display') == 'none') {