25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

28 satır
685 B

  1. const $ = require('jquery');
  2. class Topics {
  3. constructor(section) {
  4. this.section = section.addClass('initiated');
  5. this.cols = section.find('.col');
  6. const fullOffset = Math.ceil(this.cols.length / 3) * 3 - this.cols.last().index() - 1;
  7. if (fullOffset === 0) {
  8. return;
  9. }
  10. let firstHalfWidth = this.cols.length - fullOffset * 2;
  11. if (firstHalfWidth < 0) {
  12. firstHalfWidth = 0;
  13. }
  14. this.cols.eq(firstHalfWidth).addClass('width-half').nextAll().addClass('width-half');
  15. }
  16. }
  17. $('body').on('ihk-init dynamic-component-loaded gfi-dynamic-init', function () {
  18. $('.topics:not(.initiated)').each(function(i) {
  19. new Topics($(this));
  20. });
  21. })