-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Description
I use this plugin with Backbone, materialize and sometimes (about once every ten loads) "Handlebars" and "JSON" in hbs.js are undefined, so I have some errors like "Cannot read property 'stringify' of undefined" or if Handlebars is undefined "Cannot read property 'registerHelper' of undefined".
My requirejs config:
require.config({
urlArgs: "bust=" + (new Date()).getTime(),
paths: {
jquery: 'libs/jquery.min',
tinymce: 'libs/tinymce/tinymce.min',
tinymcejquery: 'libs/tinymce/jquery.tinymce.min',
underscore: 'libs/underscore-min',
backbone: 'libs/backbone-min',
magicsuggest: "libs/magicsuggest-min",
autocomplete: "libs/jquery.auto-complete.min",
text: 'libs/text',
jqueryui: 'libs/jquery-ui-1.11.4.custom/jquery-ui.min',
settings: 'app/settings',
dateformat: 'libs/dateFormat',
scrollbar: 'libs/perfect-scrollbar.jquery.min',
socketio: 'libs/socket.io-1.3.5',
magnificpopup: 'libs/magnificpopup',
moment: 'libs/moment-with-locales.min',
hbs: 'libs/hbs',
materialize: '../materialize-AMD-master/bin/materialize',
'hammerjs': '../materialize-AMD-master/js//hammer.min',
'jquery.easing': '../materialize-AMD-master/js//jquery.easing.1.3',
'velocity': '../materialize-AMD-master/js//velocity.min',
'picker': '../materialize-AMD-master/js//date_picker/picker',
'picker.date': '../materialize-AMD-master/js//date_picker/picker.date',
'waves': '../materialize-AMD-master/js//waves',
'global': '../materialize-AMD-master/js//global',
'animation': '../materialize-AMD-master/js//animation',
'collapsible': '../materialize-AMD-master/js//collapsible',
'dropdown': '../materialize-AMD-master/js//dropdown',
'leanModal': '../materialize-AMD-master/js//leanModal',
'materialbox': '../materialize-AMD-master/js//materialbox',
'tabs': '../materialize-AMD-master/js//tabs',
'sideNav': '../materialize-AMD-master/js//sideNav',
'parallax': '../materialize-AMD-master/js//parallax',
'scrollspy': '../materialize-AMD-master/js//scrollspy',
'tooltip': '../materialize-AMD-master/js//tooltip',
'slider': '../materialize-AMD-master/js//slider',
'cards': '../materialize-AMD-master/js//cards',
'buttons': '../materialize-AMD-master/js//buttons',
'pushpin': '../materialize-AMD-master/js//pushpin',
'character_counter': '../materialize-AMD-master/js//character_counter',
'toasts': '../materialize-AMD-master/js//toasts',
'forms': '../materialize-AMD-master/js//forms',
'scrollFire': '../materialize-AMD-master/js//scrollFire',
'transitions': '../materialize-AMD-master/js//transitions',
'jquery.hammer': '../materialize-AMD-master/js//jquery.hammer'
},
shim: {
'jquery.easing': {
deps: ['jquery']
},
'animation': {
deps: ['jquery']
},
'jquery.hammer': {
deps: ['jquery', 'hammerjs', 'waves']
},
'global': {
deps: ['jquery']
},
'toasts': {
deps: ['global']
},
'collapsible': {
deps: ['jquery']
},
'dropdown': {
deps: ['jquery']
},
'leanModal': {
deps: ['jquery']
},
'materialbox': {
deps: ['jquery']
},
'parallax': {
deps: ['jquery']
},
'tabs': {
deps: ['jquery']
},
'tooltip': {
deps: ['jquery']
},
'sideNav': {
deps: ['jquery']
},
'scrollspy': {
deps: ['jquery']
},
'forms': {
deps: ['jquery', 'global']
},
'slider': {
deps: ['jquery']
},
'cards': {
deps: ['jquery']
},
'pushpin': {
deps: ['jquery']
},
'buttons': {
deps: ['jquery']
},
'transitions': {
deps: ['jquery','scrollFire']
},
'scrollFire': {
deps: ['jquery', 'global']
},
'waves': {
exports: 'Waves'
},
'character_counter': {
deps: ['jquery']
},
'jqueryui': {
deps: ['jquery']
},
'autocomplete': {
deps: ['jquery']
},
hbs: {
exports: 'hbs'
},
'socketio': {
exports: 'io'
},
tinymce: {
deps: [ 'jquery' ],
exports: 'tinyMCE',
init: function () {
this.tinyMCE.DOM.events.domLoaded = true;
return this.tinyMCE;
}
},
tinymcejquery : {
deps: [ 'jquery' ]
},
'materialize': {
deps: ['jquery', 'hammerjs', 'velocity']
}
},
hbs : {
templateExtension : 'hbs',
helperDirectory : "templates/helpers/"
},
});
require([
// Load our app module and pass it to our definition function
'app/views/app',
'jquery.easing',
'animation',
'velocity',
'hammerjs',
'jquery.hammer',
'global', // very important do not remove!
'collapsible',
'dropdown',
'leanModal',
'materialbox',
'parallax',
'tabs',
'tooltip',
'waves',
'toasts',
'sideNav',
'scrollspy',
'forms',
'slider',
'cards',
'pushpin',
'buttons',
'scrollFire',
'transitions',
'picker',
'picker.date',
'character_counter'
], function( App){
new App();
});
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels