-
Notifications
You must be signed in to change notification settings - Fork 3
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
Sync deprecated #24
Comments
Ok well. It looks like adding a slash Router.route('admin', {
path: '/admin',
controller: PreloadController,
preload: {
styles: ['/semantic.css'],
async: '/semantic.js'
},
action: function() {
this.render('admin');
}
}); |
Changing the issue title since |
Ok so here is one workaround I think works in my case, using a reactive Session variable: AdminController = PreloadController.extend({
layoutTemplate: 'adminLayout',
preload: {
styles: ['/semantic/semantic.css', '/admin/admin.css'],
async: ['/semantic/semantic.js', '/admin/admin.js'],
'onBeforeAsync': function(fileName) {
Session.set('files_loaded', undefined);
return true;
},
'onAsync': function(error, result) {
if (error) {
console.log('error loading templates', loading);
} else {
var counter = Session.get('files_loaded') || 0;
Session.set('files_loaded', ++counter);
}
}
},
onBeforeAction: function() {
if (Session.equals('files_loaded', this.preload.async.length)) {
this.next();
}
}
}); |
Thanks! I'd probably go with ReactiveVar instead, but this works too :) |
Hey - I'm trying to load semantic-ui on demand, (in conjunction with the Lazy Bundles package), like below:
I get the following errors on Chrome Version 44.0.2403.89 beta (64-bit):
Note that the first issue is repeated twice, and as a matter of fact, it looks like
<link rel="preload stylesheet" type="text/css" href="semantic.css">
is inserted twice in the DOM. The second issue is easily solved by usingasync
instead ofsync
in thepreload
options.I don't get these warnings in Safari but
semantic.css
is indeed inserted twice in the DOM.The text was updated successfully, but these errors were encountered: