Still get the error message:
ManagerManager: An error has occurred: TypeError - $("iframe") is null
when clicking on a resource though. Does anyone know what could be causing this?
$('iframe').load(function()\$j('iframe').load(function()
Make the following change to the mg_backend_manager.php file:
Change:
$('iframe').load(function()
To:
\$j('iframe').load(function()
But it it works. No error message and the iframe adjusts to the height of gallery form.<?php
//---------------------------------------------------------------------------------
// mm_widget_mg_backend_manager
//---------------------------------------------------------------------------------
function mm_widget_mg_backend_manager($docid='', $title = '', $roles='', $templates='') {
global $modx, $content, $manager_theme;
$e = &$modx->Event;
if (useThisRule($roles, $templates)) {
$title = empty($title) ? "Edit gallery" : $title;
$output = "// -------------- mg_backend_manager widget include ------------- \n";
$output .= "
setInterval(\"document.getElementById('mgmanager').style.height = document.getElementById('mgmanager').contentWindow.document.body.scrollHeight+'px';\", 1000);
";
mm_createTab($title, 'mgmanager', '', '', '<iframe id="mgmanager" src="'.$modx->config['site_url'].'/?id='.$docid.'&mmgal_id='.$_GET['id'].'" width="100%" height="0" scrolling="no" frameborder="0"></iframe>');
}
$e->output($output . "\n");
}
?>
ManagerManager: An error has occurred: TypeError - Cannot call method 'hasChildNodes' of undefined
//---------------------------------------------------------------------------------
// mm_widget_mg_backend_manager
//---------------------------------------------------------------------------------
function mm_widget_mg_backend_manager($docid='', $title = '', $roles='', $templates='') {
global $modx, $id, $content, $manager_theme;
$e = &$modx->Event;
echo $iid;
if (useThisRule($roles, $templates)){
$title = empty($title) ? "Edit gallery" : $title;
if($id != 0){
mm_createTab($title, 'mgmanager', '', '', '<iframe id="mgmanager" src="'.$modx->config['site_url'].'/?id='.$docid.'&mmgal_id='.$id.'" height="500" width="100%" scrolling="yes" frameborder="0"></iframe>');
}
else
{
mm_createTab($title, 'mgmanager', '', '', 'To manage the pictures, save this document first and then re-open it for editing.');}
}
$e->output($output . "\n");
}