Skip to content

Commit

Permalink
Merge pull request discoverygarden#64 from ryanbrinn/7.x
Browse files Browse the repository at this point in the history
added is-bookreader class to #manuscript-viewer to fix bug in fullscr…
  • Loading branch information
willtp87 committed Feb 12, 2018
2 parents 0460233 + 167f1f4 commit deb0e9f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion islandora_manuscript.module
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ function islandora_manuscript_pages_menu(AbstractObject $object) {
function islandora_manuscript_theme() {
return array(
'islandora_manuscript_manuscript' => array(
'variables' => array('object' => NULL),
'variables' => array(
'object' => NULL,
'viewer_wrapper_attributes' => array(
'id' => 'manuscript-viewer',
),
),
'file' => 'theme/theme.inc',
'template' => 'theme/islandora-manuscript-manuscript',
),
Expand Down
2 changes: 1 addition & 1 deletion theme/islandora-manuscript-manuscript.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
?>
<?php if (isset($viewer)): ?>
<div id="manuscript-viewer">
<div <?php print drupal_attributes($viewer_wrapper_attributes); ?>>
<?php print $viewer; ?>
</div>
<?php endif; ?>
Expand Down
7 changes: 7 additions & 0 deletions theme/theme.inc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ function template_preprocess_islandora_manuscript_manuscript(array &$variables)
$viewer = islandora_get_viewer($params, 'islandora_manuscript_viewers');
if ($viewer) {
$variables['viewer'] = $viewer;
if (islandora_get_viewer_id('islandora_manuscript_viewers') == 'islandora_internet_archive_bookreader') {
// Add in our IA class if applicable.
// Create the class array here so we don't get an empty attribute.
$variables['viewer_wrapper_attributes']['class'] = array();
$variables['viewer_wrapper_attributes']['class'][] = 'ia-bookreader';
}
}

$variables['islandora_manuscript_metadata'] = variable_get('islandora_manuscript_metadata_display', FALSE);
if ($variables['islandora_manuscript_metadata']) {
drupal_add_js('misc/form.js');
Expand Down

0 comments on commit deb0e9f

Please sign in to comment.