Skip to content

Instantly share code, notes, and snippets.

@illepic
Last active September 26, 2018 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save illepic/875bccfdc30822fd608b9a23a36bf50b to your computer and use it in GitHub Desktop.
Save illepic/875bccfdc30822fd608b9a23a36bf50b to your computer and use it in GitHub Desktop.
Drupal.t() - Particle integration version 2
import { enableAllComponents } from '../../source/design-system';
console.log('drupal-theme ran');
Drupal.behaviors.designSystem = {
attach($context, settings) {
const componentSettings = {
// Carousel settings!
carousel: {
strings: {
goForwardText: Drupal.t('Go forward'),
goBackText: Drupal.t('Go back'),
},
},
// Flerp component settings!
flerp: {
strings: {
merp: 'merp',
},
height: settings.drupalCustomModule.height, // Note: this is how we pull in drupalSettings if needed
speed: settings.drupalCustomModule.speed,
},
};
enableAllComponents($context, componentSettings);
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment