Conversation
| "repository": {}, | ||
| "devDependencies": { | ||
| "breakpoint-sass": "^2.7.0", | ||
| "browser-sync": "^2.12.3", |
|
would be cool to add something about slider in styleguide aswell |
|
|
||
| // To understand behaviors, see https://drupal.org/node/756722#behaviors | ||
| Drupal.behaviors.my_custom_behavior = { | ||
| Drupal.behaviors.slider = { |
There was a problem hiding this comment.
i suggest to create a new file for sliders. Not script.js
There was a problem hiding this comment.
Agree, thank you for review.
|
@iberdinsky-skilld KSS for now because it's unusable and not readable. |
…wesome libraries.
|
Code updated. |
| @@ -0,0 +1,26 @@ | |||
| (function (Drupal, $, debounce, drupalSettings) { | |||
| console.log('bu'); | |||
|
Would be cool to divide this MR to 3:
Since it is pretty big all toghether. so hard to test. |
| }, | ||
| "private": true, | ||
| "scripts": { | ||
| "install": "npm remove jquery", |
There was a problem hiding this comment.
What do we need this for?
| // and, in this file's first line of JS, change function (Drupal) to | ||
| // (Drupal, $) | ||
| })(Drupal); | ||
| })(Drupal, jQuery, Drupal.debounce, drupalSettings); |
There was a problem hiding this comment.
If you are already passing Drupal, then you don't need to also pass Drupal.debounce
| // - https://drupal.org/node/1446420 | ||
| // - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth | ||
| (function (Drupal) { | ||
| (function (Drupal, $, debounce, drupalSettings) { |
| slider.slick(options); | ||
| } | ||
| }; | ||
| })(Drupal, jQuery, Drupal.debounce, drupalSettings); |
There was a problem hiding this comment.
Same: no need for Drupal.debounce
| } | ||
| ]; | ||
|
|
||
| for (var i = 0; i < opt.length; i++) { |
There was a problem hiding this comment.
Not sure about this way of initializing the sliders, they will all share the same config/options. Maybe better to provide a slider.js as example but commented out / not included.
| @import 'init/image-url/image-url'; | ||
|
|
||
| // Add the Font Awesome mixins. | ||
| @import '../node_modules/components-font-awesome/scss/mixins'; |
There was a problem hiding this comment.
Do not use the node_modules there, instead:
$fa-font-path: '../../../fonts/FontAwesome';
@import 'font-awesome/scss/font-awesome';
| @import 'chroma-sass/sass/chroma/functions'; | ||
|
|
||
| // Add the Font Awesome variables. | ||
| @import '../node_modules/components-font-awesome/scss/variables'; |
There was a problem hiding this comment.
Same. Do not use node_modules in the path.
|
|
||
| slick-carousel: | ||
| js: | ||
| node_modules/slick-carousel/slick/slick.min.js: {} |
There was a problem hiding this comment.
This won't work. node_modules path will be gone at page execution time.
| node_modules/slick-carousel/slick/slick.min.js: {} | ||
| css: | ||
| component: | ||
| node_modules/slick-carousel/slick/slick.css: {} |
There was a problem hiding this comment.
This won't work. node_modules path will be gone at page execution time.
…ontAwesome libraries.