When using Administration Menu module half of the browse frame in img_assist popup displays below the visible area and you need to scroll to see it properly

The attached patch adds a style block after the drupal styles that overrides the admin menu margin and restores correct display to the popup.

Comments

sun’s picture

Hm. Yes, I've seen this issue myself before. However, I'm still tinkering about whether this could be fixed once for all contrib modules in admin_menu (instead of in multiple other contrib modules).

forngren’s picture

Is a more generic solution possible? Simple menu breaks the layout in a similar way in D6.

EDIT: okey, found the theme_ functions, so problem solved

EDIT 2: well, problem solved for me, but this should really be fixed by default.

sun’s picture

@forngren: Do you want to let us know what you have changed to solve this?

forngren’s picture

It's not pretty, but gets the job done. It would be smarter to include the correct (i.e. drupal core etc) scripts rather than blacklist the bad ones (simple menu). I will probably figure some more after I get some sleep.

function theme_img_assist_page($content, $attributes = NULL) {
  $title = drupal_get_title();
  $output = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";
  $output .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'."\n";
  $output .= "<head>\n";
  $output .= '<title>'. $title ."</title>\n";
  $output .= drupal_get_html_head();

  $lines = preg_split('/\n/', drupal_get_js());
  foreach ($lines as $line) {
    if (stristr($line, 'simplemenu') !== false) continue;
    $output .= $line;

  }
  $output .= "<style type=\"text/css\" media=\"all\">@import \"". base_path() . drupal_get_path('module', 'img_assist') .'/img_assist.css ."\";</style>\n";

  $output .= "</head>\n";
  $output .= '<body'. drupal_attributes($attributes) .">\n";

  $output .= theme_status_messages();

  $output .= $content;
  $output .= '</body>';
  $output .= '</html>';
  return $output;
}

Ohh, and btw, this line

  // Ensure that img_assist.js is imported last.

should probably be changed to:

  // Ensure that img_assist.css is imported last.
sun’s picture

Title: Layout issue when Administration Menu module is in use » Allow modules to disable admin_menu
Project: Image Assist » Administration menu
Version: 5.x-1.6 » 6.x-1.x-dev
Component: User interface » Code
Assigned: realityloop » Unassigned
Status: Needs review » Active

Moving over to admin_menu's queue.

sun’s picture

Status: Active » Needs work
StatusFileSize
new631 bytes

This is just the JS patch to prevent DAM from applying a margin-top if it's not output at all.

pwolanin’s picture

Status: Needs work » Needs review
StatusFileSize
new1.96 KB

patch that adds the new function plus above JS change.

pwolanin’s picture

StatusFileSize
new2.06 KB

ok, we can simplify this for other modules, so they don't need to pass an argument.

See corresponding issue for advanced_help: http://drupal.org/node/285020

sun’s picture

Status: Needs review » Fixed

Committed to HEAD, 6.x, and 5.x, thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.