codelation_assets 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9bf21642cb3b48b0e849b9c33cb37e8cffcd1e33
4
- data.tar.gz: fbe8b036d9eae571d013962eae06223420892278
3
+ metadata.gz: 8471ba4e0412a2eb886441917e98998382df5a70
4
+ data.tar.gz: f81588591520e9f2d691a0aca6ff212be7f1c8bd
5
5
  SHA512:
6
- metadata.gz: e14b15b966e8836036b0b553ec2394fb29bd6594cdeae16bf22227cec0c6439cde4b29cad294d15d959541250d94ee9dc731c3d9a10212075d8e88d5d0365a37
7
- data.tar.gz: b6f53c2b0abf70257108638b81a46fa72690fe591199bab776201a83c2a5ea56f7d52c8449f8dd06ea5ad9b03f98384122d9fe72132d657a2537b676eae80746
6
+ metadata.gz: b03f53088d94d8423daea79a1c955d23c2d2e5b5d043afc281c99efc3b0cf07720e0c3480d3265ea8360b271412cf2a5c3beaa69798b2f79de115fad620cd889
7
+ data.tar.gz: fe5027944440fd636ea101daba7a1248d5fe6ae1822b55be1bd979717cf6d24e4033810bddecedb3f87e012d19d04beaa17a2b28411a49951ee7fc16ccfc5016
@@ -0,0 +1,24 @@
1
+ (function() {
2
+ "use strict";
3
+
4
+ // Used with the `has-cards` and `has-columns` Sass mixins,
5
+ // it appends an extra span element for each missing column
6
+ // based on the number of columns defined in the CSS.
7
+ App.register('component').enter(function() {
8
+ var columns, children, container, missingColumns;
9
+
10
+ $('body *').each(function() {
11
+ container = $(this);
12
+ columns = container.css('column-count');
13
+
14
+ // Ignore elements without column-count
15
+ if (columns === 'auto') { return; }
16
+
17
+ children = container.children().length;
18
+ missingColumns = columns - (children % columns);
19
+ for (var i = 0; i < missingColumns; i++) {
20
+ container.append('<span></span>');
21
+ }
22
+ });
23
+ });
24
+ })();
@@ -1,3 +1,3 @@
1
1
  module CodelationAssets
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.1.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codelation_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Pattison
@@ -65,7 +65,7 @@ files:
65
65
  - Rakefile
66
66
  - app/assets/javascripts/codelation.js
67
67
  - app/assets/javascripts/codelation/app.js
68
- - app/assets/javascripts/codelation/components/columns.js
68
+ - app/assets/javascripts/codelation/components/has_columns.js
69
69
  - app/assets/stylesheets/_normalize.scss
70
70
  - app/assets/stylesheets/codelation.scss
71
71
  - app/assets/stylesheets/codelation/functions/color.scss
@@ -1,15 +0,0 @@
1
- $(document).ready(function() {
2
- var elementsWithColumns = $('body *').filter(function() {
3
- return $(this).css('column-count') !== 'auto';
4
- });
5
-
6
- elementsWithColumns.each(function() {
7
- var container = $(this);
8
- var columns = container.css('column-count');
9
- var children = container.children().length;
10
- var missingColumns = columns - (children % columns);
11
- for (var i = 0; i < missingColumns; i++) {
12
- container.append('<span></span>');
13
- }
14
- });
15
- });