Skip to content

Commit

Permalink
Merge branch '78-base-mixin-beta'
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanpalmer committed Jan 22, 2016
2 parents 326d415 + 0ce9bed commit be2453b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions addon/mixins/base.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import Ember from 'ember';
import Semantic from '../semantic';

// Static properties to ignore
const DEBUG = ['debug', 'performance', 'verbose'];
const STANDARD = ['name', 'namespace', 'className', 'error', 'metadata', 'selector'];
const EMBER = ['context', 'on', 'template', 'execute'];


Semantic.BaseMixin = Ember.Mixin.create({
init: function() {
this._super();
Expand All @@ -26,19 +32,19 @@ Semantic.BaseMixin = Ember.Mixin.create({

for (key in component.settings) {
prop = component.settings[key];
if (window.$.inArray(key, Semantic.BaseMixin.DEBUG) >= 0) {
if (window.$.inArray(key, DEBUG) >= 0) {
continue;
}

if (window.$.inArray(key, Semantic.BaseMixin.STANDARD) >= 0) {
if (window.$.inArray(key, STANDARD) >= 0) {
continue;
}

if (typeof prop === 'function' && typeof (this.get(key) || this.get(`_${key}`)) !== 'function') {
continue;
}

if (window.$.inArray(key, Semantic.BaseMixin.EMBER) >= 0) {
if (window.$.inArray(key, EMBER) >= 0) {
value = this.get(`ui_${key}`);
} else {
if (typeof this.get(key) !== 'undefined') {
Expand Down Expand Up @@ -122,9 +128,4 @@ Semantic.BaseMixin = Ember.Mixin.create({
}
});

// Static properties to ignore
Semantic.BaseMixin.DEBUG = ['debug', 'performance', 'verbose'];
Semantic.BaseMixin.STANDARD = ['name', 'namespace', 'className', 'error', 'metadata', 'selector'];
Semantic.BaseMixin.EMBER = ['context', 'on', 'template', 'execute'];

export default Semantic.BaseMixin;

0 comments on commit be2453b

Please sign in to comment.