Commit f02df33a by David Baumgold

Merge pull request #1571 from edx/db/js-main-setup

Do JS setup immediately when possible
parents 3895a3fa b119a909
......@@ -2,17 +2,16 @@ define ["domReady", "jquery", "underscore.string", "backbone", "gettext",
"js/views/feedback_notification",
"coffee/src/ajax_prefix", "jquery.cookie"],
(domReady, $, str, Backbone, gettext, NotificationView) ->
AjaxPrefix.addAjaxPrefix jQuery, ->
$("meta[name='path_prefix']").attr('content')
window.CMS = window.CMS or {}
CMS.URL = CMS.URL or {}
window.onTouchBasedDevice = ->
navigator.userAgent.match /iPhone|iPod|iPad/i
main = ->
AjaxPrefix.addAjaxPrefix jQuery, ->
$("meta[name='path_prefix']").attr('content')
_.extend CMS, Backbone.Events
window.CMS = window.CMS or {}
CMS.URL = CMS.URL or {}
window.onTouchBasedDevice = ->
navigator.userAgent.match /iPhone|iPod|iPad/i
main = ->
_.extend CMS, Backbone.Events
Backbone.emulateHTTP = true
$.ajaxSetup
......@@ -48,8 +47,9 @@ define ["domReady", "jquery", "underscore.string", "backbone", "gettext",
data: JSON.stringify(data)
success: callback
if onTouchBasedDevice()
$('body').addClass 'touch-based-device'
domReady ->
if onTouchBasedDevice()
$('body').addClass 'touch-based-device'
domReady(main)
main()
return main
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment