Skip to content

Commit 1e0a12d

Browse files
authored
Minor Optimization and version bump (#59)
Test are passing cc/ @alexdiliberto @jbailey4
1 parent 9afee52 commit 1e0a12d

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

addon/components/bulma-column.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import Ember from 'ember';
22
import layout from '../templates/components/bulma-column';
3-
import { _responsiveHelpers } from '../constants';
3+
import { _responsiveHelpers, _gridBindings } from '../constants';
44

55
const {
66
Component,
7-
inject: { service },
8-
get,
97
set
108
} = Ember;
119

1210
export default Component.extend({
1311
layout,
1412
classNames: ['column'],
15-
gridBindings: service('grid-bindings'),
13+
// REVIEW can this property and the concatBindings method be combined as an es5 get or computed?
1614
classNameBindings: [],
1715

1816
/**
@@ -22,8 +20,7 @@ export default Component.extend({
2220
@private
2321
*/
2422
concatBindings() {
25-
let gridBindings = get(this, 'gridBindings.all');
26-
set(this, 'classNameBindings', ['content'].concat(gridBindings, _responsiveHelpers));
23+
set(this, 'classNameBindings', ['content'].concat(_gridBindings, _responsiveHelpers));
2724
},
2825

2926
init() {

addon/constants.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,11 @@ export const _responsiveHelpers = [
7070
'inlineBlock:inline-block',
7171
'inlineFlex:inline-flex'
7272
];
73+
74+
/**
75+
All the grid attribute bindings
76+
77+
@property gridBindings
78+
@private
79+
*/
80+
export const _gridBindings = ['isThreeQuarters:is-three-quarters', 'isOffsetThreeQuarters:is-offset-three-quarters', 'isNarrowThreeQuarters:is-narrow-three-quarters', 'isThreeQuartersDesktop:is-three-quarters-desktop', 'isThreeQuartersMobile:is-three-quarters-mobile', 'isThreeQuartersTablet:is-three-quarters-tablet', 'isTwoThirds:is-two-thirds', 'isOffsetTwoThirds:is-offset-two-thirds', 'isNarrowTwoThirds:is-narrow-two-thirds', 'isTwoThirdsDesktop:is-two-thirds-desktop', 'isTwoThirdsMobile:is-two-thirds-mobile', 'isTwoThirdsTablet:is-two-thirds-tablet', 'isHalf:is-half', 'isOffsetHalf:is-offset-half', 'isNarrowHalf:is-narrow-half', 'isHalfDesktop:is-half-desktop', 'isHalfMobile:is-half-mobile', 'isHalfTablet:is-half-tablet', 'isOneThird:is-one-third', 'isOffsetOneThird:is-offset-one-third', 'isNarrowOneThird:is-narrow-one-third', 'isOneThirdDesktop:is-one-third-desktop', 'isOneThirdMobile:is-one-third-mobile', 'isOneThirdTablet:is-one-third-tablet', 'isOneQuarter:is-one-quarter', 'isOffsetOneQuarter:is-offset-one-quarter', 'isNarrowOneQuarter:is-narrow-one-quarter', 'isOneQuarterDesktop:is-one-quarter-desktop', 'isOneQuarterMobile:is-one-quarter-mobile', 'isOneQuarterTablet:is-one-quarter-tablet', 'is1:is-1', 'isOffset1:is-offset-1', 'isNarrow1:is-narrow-1', 'is1Desktop:is-1-desktop', 'is1Mobile:is-1-mobile', 'is1Tablet:is-1-tablet', 'is2:is-2', 'isOffset2:is-offset-2', 'isNarrow2:is-narrow-2', 'is2Desktop:is-2-desktop', 'is2Mobile:is-2-mobile', 'is2Tablet:is-2-tablet', 'is3:is-3', 'isOffset3:is-offset-3', 'isNarrow3:is-narrow-3', 'is3Desktop:is-3-desktop', 'is3Mobile:is-3-mobile', 'is3Tablet:is-3-tablet', 'is4:is-4', 'isOffset4:is-offset-4', 'isNarrow4:is-narrow-4', 'is4Desktop:is-4-desktop', 'is4Mobile:is-4-mobile', 'is4Tablet:is-4-tablet', 'is5:is-5', 'isOffset5:is-offset-5', 'isNarrow5:is-narrow-5', 'is5Desktop:is-5-desktop', 'is5Mobile:is-5-mobile', 'is5Tablet:is-5-tablet', 'is6:is-6', 'isOffset6:is-offset-6', 'isNarrow6:is-narrow-6', 'is6Desktop:is-6-desktop', 'is6Mobile:is-6-mobile', 'is6Tablet:is-6-tablet', 'is7:is-7', 'isOffset7:is-offset-7', 'isNarrow7:is-narrow-7', 'is7Desktop:is-7-desktop', 'is7Mobile:is-7-mobile', 'is7Tablet:is-7-tablet', 'is8:is-8', 'isOffset8:is-offset-8', 'isNarrow8:is-narrow-8', 'is8Desktop:is-8-desktop', 'is8Mobile:is-8-mobile', 'is8Tablet:is-8-tablet', 'is9:is-9', 'isOffset9:is-offset-9', 'isNarrow9:is-narrow-9', 'is9Desktop:is-9-desktop', 'is9Mobile:is-9-mobile', 'is9Tablet:is-9-tablet', 'is10:is-10', 'isOffset10:is-offset-10', 'isNarrow10:is-narrow-10', 'is10Desktop:is-10-desktop', 'is10Mobile:is-10-mobile', 'is10Tablet:is-10-tablet', 'is11:is-11', 'isOffset11:is-offset-11', 'isNarrow11:is-narrow-11', 'is11Desktop:is-11-desktop', 'is11Mobile:is-11-mobile', 'is11Tablet:is-11-tablet'];

addon/services/grid-bindings.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ export default Service.extend({
4747
},
4848

4949
init() {
50-
this._generateAllBindings();
50+
/*
51+
REVIEW Why do this assemblage as a process when values are always static?
52+
Instead just use static result as a constant, and keep this code if nomenclature changes, but never execute
53+
*/
54+
// this._generateAllBindings();
5155
}
5256
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ember-bulma",
3-
"version": "0.1.6",
3+
"version": "0.1.7",
44
"description": "Ember Bulma is a collection of Ember components and services for Bulma, a modern CSS framework by Jeremy Thomas",
55
"keywords": [
66
"ember-addon",

0 commit comments

Comments
 (0)