Changeset 32778 for main/trunk


Ignore:
Timestamp:
2019-02-15T17:05:34+13:00 (5 years ago)
Author:
ak19
Message:

Need to set the surrounding div width to be the same/no more than the img/page screenshot's width, so that GS doc view's TOC links are still at the top in terms of z-index and therefore still clickable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/PDFv2Plugin.pm

    r32499 r32778  
    516516    # div that's to replace this page's <body>:
    517517    my $img_height = $dom->find('img')->[0]{height};
    518 
     518    # Also need to know the img width to set the surrounding div width to be no
     519    # more than the img/page's screenshot width, so that the links in the GS doc
     520    # view's table of contents are still at the top (z-index) and responsive.
     521    my $img_width = $dom->find('img')->[0]{width};
     522   
    519523    # 2. Adjust the img#background src attribute to point to the pages subdir for imgs
    520524    # 3. Set that img tag's class=background, and change its id to background+$page_num
     
    542546    # Must be: <div id="$page_num" style="position:relative; height:$img_height;"/>
    543547#    my $new_dom = Mojo::DOM->new_tag('div', id => "page".$page_num, style => "position: relative; height: ".$img_height."px;" )
    544     my $new_dom = Mojo::DOM->new_tag('div', style => "position: relative; height: ".$img_height."px;" );
     548    my $new_dom = Mojo::DOM->new_tag('div', style => "position: relative; height: ".$img_height."px; width: ".$img_width."px;");
    545549#$self->_debug_print_html($new_dom);
    546550    $new_dom->at('div')->append_content($style_element)->root;
Note: See TracChangeset for help on using the changeset viewer.