Sha256: 56d77621a93578f487ea5cad2bc8ad0fa0045dc81ea022f9e63d2064b4ca2986

Contents?: true

Size: 727 Bytes

Versions: 11

Compression:

Stored size: 727 Bytes

Contents

(function() {
  "use strict";

  // Used with the `has-grid` and `has-cards` Sass mixins,
  // it appends an extra span element for each missing column
  // based on the number of columns defined in the CSS.
  App.register('component').enter(function() {
    var columns, children, container, missingColumns;

    $('body *').each(function() {
      container = $(this);
      columns = container.css('column-count');

      // Ignore elements without column-count
      if (columns === 'auto') { return; }

      children = container.children().length;
      missingColumns = columns - (children % columns);
      for (var i = 0; i < missingColumns; i++) {
        container.append('<div></div>');
      }
    });
  });
})();

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
codelation_ui-1.0.57 app/assets/javascripts/codelation_ui/_base_resources/components/has_grid.js
codelation_ui-1.0.1 app/assets/javascripts/codelation_ui/_base_resources/components/has_grid.js
codelation_ui-1.0.0 app/assets/javascripts/codelation_ui/_base_resources/components/has_grid.js
codelation_assets-0.5.0 app/assets/javascripts/codelation/components/has_grid.js
codelation_assets-0.4.0 app/assets/javascripts/codelation/components/has_grid.js
codelation_assets-0.3.9 app/assets/javascripts/codelation/components/has_grid.js
codelation_assets-0.3.8 app/assets/javascripts/codelation/components/has_grid.js
codelation_assets-0.3.7 app/assets/javascripts/codelation/components/has_grid.js
codelation_assets-0.3.6 app/assets/javascripts/codelation/components/has_grid.js
codelation_assets-0.3.5 app/assets/javascripts/codelation/components/has_grid.js
codelation_assets-0.3.4 app/assets/javascripts/codelation/components/has_grid.js