Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
f02df33a
Commit
f02df33a
authored
Nov 05, 2013
by
David Baumgold
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1571 from edx/db/js-main-setup
Do JS setup immediately when possible
parents
3895a3fa
b119a909
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
cms/static/coffee/src/main.coffee
+12
-12
No files found.
cms/static/coffee/src/main.coffee
View file @
f02df33a
...
@@ -2,17 +2,16 @@ define ["domReady", "jquery", "underscore.string", "backbone", "gettext",
...
@@ -2,17 +2,16 @@ define ["domReady", "jquery", "underscore.string", "backbone", "gettext",
"js/views/feedback_notification"
,
"js/views/feedback_notification"
,
"coffee/src/ajax_prefix"
,
"jquery.cookie"
],
"coffee/src/ajax_prefix"
,
"jquery.cookie"
],
(
domReady
,
$
,
str
,
Backbone
,
gettext
,
NotificationView
)
->
(
domReady
,
$
,
str
,
Backbone
,
gettext
,
NotificationView
)
->
AjaxPrefix
.
addAjaxPrefix
jQuery
,
->
main
=
->
$
(
"meta[name='path_prefix']"
).
attr
(
'content'
)
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
_
.
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
Backbone
.
emulateHTTP
=
true
$
.
ajaxSetup
$
.
ajaxSetup
...
@@ -48,8 +47,9 @@ define ["domReady", "jquery", "underscore.string", "backbone", "gettext",
...
@@ -48,8 +47,9 @@ define ["domReady", "jquery", "underscore.string", "backbone", "gettext",
data
:
JSON
.
stringify
(
data
)
data
:
JSON
.
stringify
(
data
)
success
:
callback
success
:
callback
if
onTouchBasedDevice
()
domReady
->
$
(
'body'
).
addClass
'touch-based-device'
if
onTouchBasedDevice
()
$
(
'body'
).
addClass
'touch-based-device'
domReady
(
main
)
main
(
)
return
main
return
main
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment