Skip to content

Commit

Permalink
feat(shs-5693): attached files for tables in wysiwyg and views
Browse files Browse the repository at this point in the history
  • Loading branch information
Mari Nez committed Nov 30, 2024
1 parent ccba6d6 commit 51d05f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docroot/themes/humsci/humsci_basic/humsci_basic.libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ search:
secondarymenu:
js:
dist/js/secondarytoggler.js: {}

tablewrap:
js:
dist/js/tablewrap.js: {}
10 changes: 10 additions & 0 deletions docroot/themes/humsci/humsci_basic/humsci_basic.theme
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ function humsci_basic_preprocess_we_megamenu_frontend(&$vars) {
*/
function humsci_basic_preprocess_views_view(&$variables) {
$view = $variables['view'];
$variables['#attached']['library'][] = 'humsci_basic/tablewrap';

switch ($view->id()) {
case 'hs_default_search':
Expand Down Expand Up @@ -250,3 +251,12 @@ function humsci_basic_preprocess_paragraph(&$variables) {
}
$variables['content']['field_hs_view'][0]['#heading_tag'] = $heading_tag;
}

/**
* Implements hook_preprocess_HOOK().
*/
function humsci_basic_preprocess_field(&$variables) {
if ($variables['field_name'] == 'field_hs_text_area') {
$variables['#attached']['library'][] = 'humsci_basic/tablewrap';
}
}

0 comments on commit 51d05f8

Please sign in to comment.