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
cfa7cd3d
Commit
cfa7cd3d
authored
Feb 26, 2016
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Pass DOM element, not jQuery object to XBlock initialisation."
parent
e5108dc7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
14 deletions
+13
-14
cms/static/js/views/xblock.js
+1
-1
cms/static/js/xblock/authoring.js
+8
-9
common/lib/xmodule/xmodule/js/src/html/edit.coffee
+1
-1
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
+1
-1
common/lib/xmodule/xmodule/js/src/tabs/tabs-aggregator.coffee
+1
-1
common/static/js/xblock/core.js
+1
-1
No files found.
cms/static/js/views/xblock.js
View file @
cfa7cd3d
...
...
@@ -43,7 +43,7 @@ define(["jquery", "underscore", "common/js/components/utils/view_utils", "js/vie
fragmentsRendered
.
always
(
function
()
{
xblockElement
=
self
.
$
(
'.xblock'
).
first
();
try
{
xblock
=
XBlock
.
initializeBlock
(
xblockElement
.
get
(
0
)
);
xblock
=
XBlock
.
initializeBlock
(
xblockElement
);
self
.
xblock
=
xblock
;
self
.
xblockReady
(
xblock
);
if
(
successCallback
)
{
...
...
cms/static/js/xblock/authoring.js
View file @
cfa7cd3d
...
...
@@ -5,7 +5,6 @@
'use strict'
;
function
VisibilityEditorView
(
runtime
,
element
)
{
var
$element
=
$
(
element
);
this
.
getGroupAccess
=
function
()
{
var
groupAccess
=
{},
checkboxValues
,
...
...
@@ -16,12 +15,12 @@
// defined by VerificationPartitionScheme on the backend!
ALLOW_GROUP_ID
=
1
;
if
(
$
element
.
find
(
'.visibility-level-all'
).
prop
(
'checked'
))
{
if
(
element
.
find
(
'.visibility-level-all'
).
prop
(
'checked'
))
{
return
{};
}
// Cohort partitions (user is allowed to select more than one)
$
element
.
find
(
'.field-visibility-content-group input:checked'
).
each
(
function
(
index
,
input
)
{
element
.
find
(
'.field-visibility-content-group input:checked'
).
each
(
function
(
index
,
input
)
{
checkboxValues
=
$
(
input
).
val
().
split
(
"-"
);
partitionId
=
parseInt
(
checkboxValues
[
0
],
10
);
groupId
=
parseInt
(
checkboxValues
[
1
],
10
);
...
...
@@ -34,7 +33,7 @@
});
// Verification partitions (user can select exactly one)
if
(
$
element
.
find
(
'#verification-access-checkbox'
).
prop
(
'checked'
))
{
if
(
element
.
find
(
'#verification-access-checkbox'
).
prop
(
'checked'
))
{
partitionId
=
parseInt
(
$
(
'#verification-access-dropdown'
).
val
(),
10
);
groupAccess
[
partitionId
]
=
[
ALLOW_GROUP_ID
];
}
...
...
@@ -43,19 +42,19 @@
};
// When selecting "all students and staff", uncheck the specific groups
$
element
.
find
(
'.field-visibility-level input'
).
change
(
function
(
event
)
{
element
.
find
(
'.field-visibility-level input'
).
change
(
function
(
event
)
{
if
(
$
(
event
.
target
).
hasClass
(
'visibility-level-all'
))
{
$
element
.
find
(
'.field-visibility-content-group input, .field-visibility-verification input'
)
element
.
find
(
'.field-visibility-content-group input, .field-visibility-verification input'
)
.
prop
(
'checked'
,
false
);
}
});
// When selecting a specific group, deselect "all students and staff" and
// select "specific content groups" instead.`
$
element
.
find
(
'.field-visibility-content-group input, .field-visibility-verification input'
)
element
.
find
(
'.field-visibility-content-group input, .field-visibility-verification input'
)
.
change
(
function
()
{
$
element
.
find
(
'.visibility-level-all'
).
prop
(
'checked'
,
false
);
$
element
.
find
(
'.visibility-level-specific'
).
prop
(
'checked'
,
true
);
element
.
find
(
'.visibility-level-all'
).
prop
(
'checked'
,
false
);
element
.
find
(
'.visibility-level-specific'
).
prop
(
'checked'
,
true
);
});
}
...
...
common/lib/xmodule/xmodule/js/src/html/edit.coffee
View file @
cfa7cd3d
...
...
@@ -26,7 +26,7 @@ class @HTMLEditingDescriptor
CUSTOM_FONTS
+
STANDARD_FONTS
constructor
:
(
element
)
->
@
element
=
$
(
element
)
@
element
=
element
@
base_asset_url
=
@
element
.
find
(
"#editor-tab"
).
data
(
'base-asset-url'
)
@
editor_choice
=
@
element
.
find
(
"#editor-tab"
).
data
(
'editor'
)
if
@
base_asset_url
==
undefined
...
...
common/lib/xmodule/xmodule/js/src/problem/edit.coffee
View file @
cfa7cd3d
...
...
@@ -13,7 +13,7 @@ class @MarkdownEditingDescriptor extends XModule.Descriptor
@
explanationTemplate
:
"[explanation]
\n
#{
gettext
'Short explanation'
}
\n
[explanation]
\n
"
constructor
:
(
element
)
->
@
element
=
$
(
element
)
@
element
=
element
if
$
(
".markdown-box"
,
@
element
).
length
!=
0
@
markdown_editor
=
CodeMirror
.
fromTextArea
(
$
(
".markdown-box"
,
element
)[
0
],
{
...
...
common/lib/xmodule/xmodule/js/src/tabs/tabs-aggregator.coffee
View file @
cfa7cd3d
...
...
@@ -2,7 +2,7 @@ class @TabsEditingDescriptor
@
isInactiveClass
:
"is-inactive"
constructor
:
(
element
)
->
@
element
=
$
(
element
)
@
element
=
element
;
###
Not tested on syncing of multiple editors of same type in tabs
(Like many CodeMirrors).
...
...
common/static/js/xblock/core.js
View file @
cfa7cd3d
...
...
@@ -69,7 +69,7 @@
}
else
{
block
=
{};
}
block
.
element
=
$
element
;
block
.
element
=
element
;
block
.
name
=
$element
.
data
(
'name'
);
block
.
type
=
$element
.
data
(
'block-type'
);
$element
.
trigger
(
'xblock-initialized'
);
...
...
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