Skip to content

Commit

Permalink
fix(all): fix dependency to materialize
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-guilbault committed Jun 7, 2015
1 parent 0aa3767 commit c872fa9
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 22 deletions.
18 changes: 2 additions & 16 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ System.config({
"*": "*.js",
"github:*": "jspm_packages/github/*.js",
"npm:*": "jspm_packages/npm/*.js"
},
"shim": {
"packages": {
"materialize": {
"main": "materialize",
"format": "global",
"deps": "jquery",
"exports": "Materialize"
}
}
}
});

Expand All @@ -23,7 +13,7 @@ System.config({
"aurelia-dependency-injection": "github:aurelia/[email protected]",
"aurelia-templating": "github:aurelia/[email protected]",
"css": "github:systemjs/[email protected]",
"jquery": "npm:[email protected]",
"jquery": "github:components/[email protected]",
"materialize": "github:dogfalo/[email protected]",
"traceur": "github:jmcriffey/[email protected]",
"traceur-runtime": "github:jmcriffey/[email protected]",
Expand Down Expand Up @@ -59,8 +49,7 @@ System.config({
"core-js": "npm:[email protected]"
},
"github:dogfalo/[email protected]": {
"css": "github:systemjs/[email protected]",
"jquery": "github:components/[email protected]"
"css": "github:systemjs/[email protected]"
},
"github:jspm/[email protected]": {
"assert": "npm:[email protected]"
Expand Down Expand Up @@ -150,9 +139,6 @@ System.config({
"npm:[email protected]": {
"util": "github:jspm/[email protected]"
},
"npm:[email protected]": {
"process": "github:jspm/[email protected]"
},
"npm:[email protected]": {
"os": "github:jspm/[email protected]"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"aurelia-dependency-injection": "github:aurelia/dependency-injection@^0.7.1",
"aurelia-templating": "github:aurelia/templating@^0.11.2",
"css": "github:systemjs/plugin-css@^0.1.9",
"jquery": "npm:jquery@^2.1.4",
"jquery": "github:components/jquery@^2.1.4",
"materialize": "github:dogfalo/materialize@^0.96.1"
},
"devDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'jquery';
import 'materialize/bin/materialize';
import 'materialize/bin/materialize.css!';
import 'materialize';

export {MaterializeSelect} from './select';
export {MaterializeSideNav} from './side-nav';
Expand All @@ -11,4 +10,4 @@ export function configure(aurelia) {
'./select',
'./side-nav'
);
}
}
3 changes: 2 additions & 1 deletion src/select.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {customAttribute, inject} from 'aurelia-framework';
import {customAttribute} from 'aurelia-templating';
import {inject} from 'aurelia-dependency-injection';
import $ from 'jquery';

@customAttribute('materialize-select')
Expand Down
3 changes: 2 additions & 1 deletion src/side-nav.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {customAttribute, inject, bindable} from 'aurelia-framework';
import {customAttribute, bindable} from 'aurelia-templating';
import {inject} from 'aurelia-dependency-injection';
import $ from 'jquery';

@customAttribute('materialize-side-nav')
Expand Down
20 changes: 20 additions & 0 deletions test/dependencies.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
describe('Dependencies config', () => {
it('should load jQuery', () => {
expect(jQuery).toBeDefined();
});

it('should register Materialize jQuery plugins', () => {
expect($('div').sideNav).toBeDefined();
});

it('should register Materialize global object', () => {
expect(Materialize).toBeDefined();
});

it('should register Materialize css', () => {
var script = $('link').filter((i, e) => {
return e.href.indexOf('materialize.css') >= 0;
});
expect(script.length).toBe(1);
});
});

0 comments on commit c872fa9

Please sign in to comment.