Skip to content

Commit deb0e9f

Browse files
authored
Merge pull request #64 from ryanbrinn/7.x
added is-bookreader class to #manuscript-viewer to fix bug in fullscr…
2 parents 0460233 + 167f1f4 commit deb0e9f

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

islandora_manuscript.module

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,12 @@ function islandora_manuscript_pages_menu(AbstractObject $object) {
177177
function islandora_manuscript_theme() {
178178
return array(
179179
'islandora_manuscript_manuscript' => array(
180-
'variables' => array('object' => NULL),
180+
'variables' => array(
181+
'object' => NULL,
182+
'viewer_wrapper_attributes' => array(
183+
'id' => 'manuscript-viewer',
184+
),
185+
),
181186
'file' => 'theme/theme.inc',
182187
'template' => 'theme/islandora-manuscript-manuscript',
183188
),

theme/islandora-manuscript-manuscript.tpl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
?>
77
<?php if (isset($viewer)): ?>
8-
<div id="manuscript-viewer">
8+
<div <?php print drupal_attributes($viewer_wrapper_attributes); ?>>
99
<?php print $viewer; ?>
1010
</div>
1111
<?php endif; ?>

theme/theme.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@ function template_preprocess_islandora_manuscript_manuscript(array &$variables)
2424
$viewer = islandora_get_viewer($params, 'islandora_manuscript_viewers');
2525
if ($viewer) {
2626
$variables['viewer'] = $viewer;
27+
if (islandora_get_viewer_id('islandora_manuscript_viewers') == 'islandora_internet_archive_bookreader') {
28+
// Add in our IA class if applicable.
29+
// Create the class array here so we don't get an empty attribute.
30+
$variables['viewer_wrapper_attributes']['class'] = array();
31+
$variables['viewer_wrapper_attributes']['class'][] = 'ia-bookreader';
32+
}
2733
}
34+
2835
$variables['islandora_manuscript_metadata'] = variable_get('islandora_manuscript_metadata_display', FALSE);
2936
if ($variables['islandora_manuscript_metadata']) {
3037
drupal_add_js('misc/form.js');

0 commit comments

Comments
 (0)