codelation_assets 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8471ba4e0412a2eb886441917e98998382df5a70
|
4
|
+
data.tar.gz: f81588591520e9f2d691a0aca6ff212be7f1c8bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
})();
|
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.
|
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/
|
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
|
-
});
|