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
37da3999
Commit
37da3999
authored
Apr 18, 2014
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update unit test based on changes in master.
parent
8e00f6dc
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
12 deletions
+16
-12
CHANGELOG.rst
+2
-0
cms/static/js/spec/views/container_spec.js
+0
-0
cms/static/js/spec/views/modals/edit_xblock_spec.js
+1
-1
cms/static/js/views/container.js
+13
-11
cms/templates/js/mock/mock-container-xblock.underscore
+0
-0
cms/templates/js/mock/mock-container.underscore
+0
-0
No files found.
CHANGELOG.rst
View file @
37da3999
...
@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes,
...
@@ -5,6 +5,8 @@ These are notable changes in edx-platform. This is a rolling list of changes,
in roughly chronological order, most recent first. Add your entries at or near
in roughly chronological order, most recent first. Add your entries at or near
the top. Include a label indicating the component affected.
the top. Include a label indicating the component affected.
Studio: Add drag-and-drop support to the container page. STUD-1309.
Common: Add extensible third-party auth module.
Common: Add extensible third-party auth module.
Blades: Handle situation if no response were sent from XQueue to LMS in Matlab
Blades: Handle situation if no response were sent from XQueue to LMS in Matlab
...
...
cms/static/js/spec/views/container_spec.js
View file @
37da3999
This diff is collapsed.
Click to expand it.
cms/static/js/spec/views/modals/edit_xblock_spec.js
View file @
37da3999
...
@@ -12,7 +12,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
...
@@ -12,7 +12,7 @@ define(["jquery", "underscore", "js/spec_helpers/create_sinon", "js/spec_helpers
beforeEach
(
function
()
{
beforeEach
(
function
()
{
edit_helpers
.
installEditTemplates
();
edit_helpers
.
installEditTemplates
();
appendSetFixtures
(
'<div class="xblock" data-locator="mock-xblock"
data-display-name="Mock XBlock"
></div>'
);
appendSetFixtures
(
'<div class="xblock" data-locator="mock-xblock"></div>'
);
model
=
new
XBlockInfo
({
model
=
new
XBlockInfo
({
id
:
'testCourse/branch/draft/block/verticalFFF'
,
id
:
'testCourse/branch/draft/block/verticalFFF'
,
display_name
:
'Test Unit'
,
display_name
:
'Test Unit'
,
...
...
cms/static/js/views/container.js
View file @
37da3999
...
@@ -4,8 +4,8 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
...
@@ -4,8 +4,8 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
xblockReady
:
function
()
{
xblockReady
:
function
()
{
XBlockView
.
prototype
.
xblockReady
.
call
(
this
);
XBlockView
.
prototype
.
xblockReady
.
call
(
this
);
var
verticalContainer
=
$
(
this
.
$el
).
find
(
'.vertical-container'
),
var
verticalContainer
=
this
.
$
(
'.vertical-container'
),
alreadySortable
=
$
(
this
.
$el
).
find
(
'.ui-sortable'
),
alreadySortable
=
this
.
$
(
'.ui-sortable'
),
newParent
,
newParent
,
oldParent
,
oldParent
,
self
=
this
;
self
=
this
;
...
@@ -16,6 +16,8 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
...
@@ -16,6 +16,8 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
handle
:
'.drag-handle'
,
handle
:
'.drag-handle'
,
stop
:
function
(
event
,
ui
)
{
stop
:
function
(
event
,
ui
)
{
var
saving
,
hideSaving
,
removeFromParent
;
console
.
log
(
'stop'
);
console
.
log
(
'stop'
);
if
(
oldParent
===
undefined
)
{
if
(
oldParent
===
undefined
)
{
...
@@ -24,12 +26,12 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
...
@@ -24,12 +26,12 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
return
;
return
;
}
}
var
saving
=
new
NotificationView
.
Mini
({
saving
=
new
NotificationView
.
Mini
({
title
:
gettext
(
'Saving…'
)
title
:
gettext
(
'Saving…'
)
});
});
saving
.
show
();
saving
.
show
();
var
hideSaving
=
function
()
{
hideSaving
=
function
()
{
saving
.
hide
();
saving
.
hide
();
};
};
...
@@ -37,12 +39,11 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
...
@@ -37,12 +39,11 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
// add to new container before deleting from old to
// add to new container before deleting from old to
// avoid creating an orphan if the addition fails.
// avoid creating an orphan if the addition fails.
if
(
newParent
)
{
if
(
newParent
)
{
var
removeFromParent
=
oldParent
;
removeFromParent
=
oldParent
;
self
.
reorder
(
newParent
,
function
()
{
self
.
reorder
(
newParent
,
function
()
{
self
.
reorder
(
removeFromParent
,
hideSaving
);
self
.
reorder
(
removeFromParent
,
hideSaving
);
});
});
}
}
else
{
else
{
// No new parent, only reordering within same container.
// No new parent, only reordering within same container.
self
.
reorder
(
oldParent
,
hideSaving
);
self
.
reorder
(
oldParent
,
hideSaving
);
}
}
...
@@ -60,8 +61,7 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
...
@@ -60,8 +61,7 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
if
(
ui
.
sender
)
{
if
(
ui
.
sender
)
{
// Move to a new container (the addition part).
// Move to a new container (the addition part).
newParent
=
parent
;
newParent
=
parent
;
}
}
else
{
else
{
// Reorder inside a container, or deletion when moving to new container.
// Reorder inside a container, or deletion when moving to new container.
oldParent
=
parent
;
oldParent
=
parent
;
}
}
...
@@ -79,16 +79,18 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
...
@@ -79,16 +79,18 @@ define(["jquery", "underscore", "js/views/xblock", "js/utils/module", "gettext",
},
},
reorder
:
function
(
targetParent
,
successCallback
)
{
reorder
:
function
(
targetParent
,
successCallback
)
{
var
children
,
childLocators
;
console
.
log
(
'calling reorder for '
+
targetParent
.
data
(
'locator'
));
console
.
log
(
'calling reorder for '
+
targetParent
.
data
(
'locator'
));
// Find descendants with class "wrapper-xblock" whose parent == targetParent.
// Find descendants with class "wrapper-xblock" whose parent == targetParent.
// This is necessary to filter our grandchildren, great-grandchildren, etc.
// This is necessary to filter our grandchildren, great-grandchildren, etc.
var
children
=
targetParent
.
find
(
'.wrapper-xblock'
).
filter
(
function
()
{
children
=
targetParent
.
find
(
'.wrapper-xblock'
).
filter
(
function
()
{
var
parent
=
$
(
this
).
parent
().
closest
(
'.wrapper-xblock'
);
var
parent
=
$
(
this
).
parent
().
closest
(
'.wrapper-xblock'
);
return
parent
.
data
(
'locator'
)
===
targetParent
.
data
(
'locator'
);
return
parent
.
data
(
'locator'
)
===
targetParent
.
data
(
'locator'
);
});
});
var
childLocators
=
_
.
map
(
childLocators
=
_
.
map
(
children
,
children
,
function
(
child
)
{
function
(
child
)
{
return
$
(
child
).
data
(
'locator'
);
return
$
(
child
).
data
(
'locator'
);
...
...
cms/templates/js/mock/mock-container-xblock.underscore
View file @
37da3999
This diff is collapsed.
Click to expand it.
cms/templates/js/mock/mock-container.underscore
deleted
100644 → 0
View file @
8e00f6dc
This diff is collapsed.
Click to expand it.
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