Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fastboot ready #330

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# compiled output
/dist
/fastboot-dist
/tmp
.idea

Expand Down
3 changes: 3 additions & 0 deletions addon/components/paper-autocomplete-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export default Ember.Component.extend({

//TODO reafactor into a computed property that binds directly to dropdown's `style`
positionDropdown() {
if (typeof FastBoot !== 'undefined') {
return;
}
var hrect = Ember.$('#' + this.get('wrapToElementId'))[0].getBoundingClientRect(),
vrect = hrect,
root = document.body.getBoundingClientRect(),
Expand Down
13 changes: 12 additions & 1 deletion addon/components/paper-grid-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export default Ember.Component.extend({
},

layoutIfMediaMatch(mediaName) {
if (typeof FastBoot !== 'undefined') {
return;
}
if (mediaName == null) {
this.send('invalidateLayout');
} else if (window.matchMedia(mediaName)) {
Expand All @@ -72,7 +75,9 @@ export default Ember.Component.extend({
},

_watchMedia() {

if (typeof FastBoot !== 'undefined') {
return;
}
const invalidateLayoutListener = this.get('_invalidateLayoutListener');

for (var mediaName in this.get('constants.MEDIA')) {
Expand Down Expand Up @@ -113,6 +118,9 @@ export default Ember.Component.extend({
},

_unwatchMedia() {
if (typeof FastBoot !== 'undefined') {
return;
}
const invalidateLayoutListener = this.get('_invalidateLayoutListener');
for(var mediaName in this.get('constants.MEDIA')) {
var query = this.get('constants.MEDIA')[mediaName] || MEDIA(mediaName);
Expand All @@ -121,6 +129,9 @@ export default Ember.Component.extend({
},

_getResponsiveAttribute(component, attrName) {
if (typeof FastBoot !== 'undefined') {
return;
}
const mediaPriorities = this.get('constants.MEDIA_PRIORITY');
for (var i = 0; i < mediaPriorities.length; i++) {
var mediaName = mediaPriorities[i],
Expand Down
3 changes: 3 additions & 0 deletions addon/components/paper-menu-content-pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ export default Ember.Component.extend({
}
},
attemptFocus(el) {
if (typeof FastBoot !== 'undefined') {
return;
}
if (el && el.getAttribute('tabindex') !== -1) {
el.focus();
if (document.activeElement === el) {
Expand Down
3 changes: 3 additions & 0 deletions addon/components/paper-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export default PaperMenuAbstract.extend({
}),

positionMenu(el) {
if (typeof FastBoot !== 'undefined') {
return;
}
// containerNode = wrapper
var containerNode = el[0],
// md-menu-content / any other child.z
Expand Down
3 changes: 3 additions & 0 deletions addon/components/paper-sidenav.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export default Ember.Component.extend({
},

matchMedia() {
if (typeof FastBoot !== 'undefined') {
return;
}
var mediaQuery = this.get('constants').MEDIA[this.get('locked-open')];
this.set('isLockedOpen', window.matchMedia(mediaQuery).matches);
if (this.get('isLockedOpen')) {
Expand Down
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ module.exports = {
included: function(app) {
this._super.included(app);

app.import(app.bowerDirectory + '/hammerjs/hammer.js');
app.import(app.bowerDirectory + '/matchMedia/matchMedia.js');
app.import('vendor/propagating.js');
if (!process.env.EMBER_CLI_FASTBOOT) {
app.import(app.bowerDirectory + '/hammerjs/hammer.js');
app.import(app.bowerDirectory + '/matchMedia/matchMedia.js');
app.import('vendor/propagating.js');
}
},
contentFor: function(type) {
if (type === 'body') {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"ember-cli-app-version": "^1.0.0",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.1.0",
"ember-cli-fastboot": "0.6.0",
"ember-cli-github-pages": "0.0.4",
"ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
Expand Down