Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-drag-and-drop-v2
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
OpenEdx
xblock-drag-and-drop-v2
Commits
dde1c6a0
Commit
dde1c6a0
authored
Aug 12, 2016
by
Matjaz Gregoric
Committed by
Tim Krones
Aug 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Select content of field when focusing it.
parent
a4466fb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
drag_and_drop_v2/public/js/drag_and_drop_edit.js
+7
-4
No files found.
drag_and_drop_v2/public/js/drag_and_drop_edit.js
View file @
dde1c6a0
...
@@ -67,6 +67,9 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -67,6 +67,9 @@ function DragAndDropEditBlock(runtime, element, params) {
// Hide settings that are specific to assessment mode
// Hide settings that are specific to assessment mode
_fn
.
build
.
$el
.
feedback
.
form
.
find
(
'.problem-mode'
).
trigger
(
'change'
);
_fn
.
build
.
$el
.
feedback
.
form
.
find
(
'.problem-mode'
).
trigger
(
'change'
);
// Set focus on first input field.
$element
.
find
(
'input:first'
).
select
();
},
},
validate
:
function
()
{
validate
:
function
()
{
...
@@ -137,7 +140,7 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -137,7 +140,7 @@ function DragAndDropEditBlock(runtime, element, params) {
$fbkTab
.
addClass
(
'hidden'
);
$fbkTab
.
addClass
(
'hidden'
);
$zoneTab
.
removeClass
(
'hidden'
);
$zoneTab
.
removeClass
(
'hidden'
);
self
.
scrollToTop
();
self
.
scrollToTop
();
$zoneTab
.
find
(
'input:first'
).
focus
();
$zoneTab
.
find
(
'input:first'
).
select
();
$
(
this
).
one
(
'click'
,
function
loadThirdTab
(
e
)
{
$
(
this
).
one
(
'click'
,
function
loadThirdTab
(
e
)
{
// $zoneTab -> $itemTab
// $zoneTab -> $itemTab
...
@@ -158,7 +161,7 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -158,7 +161,7 @@ function DragAndDropEditBlock(runtime, element, params) {
$zoneTab
.
addClass
(
'hidden'
);
$zoneTab
.
addClass
(
'hidden'
);
$itemTab
.
removeClass
(
'hidden'
);
$itemTab
.
removeClass
(
'hidden'
);
self
.
scrollToTop
();
self
.
scrollToTop
();
$itemTab
.
find
(
'input:first'
).
focus
();
$itemTab
.
find
(
'input:first'
).
select
();
$
(
this
).
addClass
(
'hidden'
);
$
(
this
).
addClass
(
'hidden'
);
$
(
'.save-button'
,
element
).
parent
()
$
(
'.save-button'
,
element
).
parent
()
...
@@ -184,7 +187,7 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -184,7 +187,7 @@ function DragAndDropEditBlock(runtime, element, params) {
e
.
preventDefault
();
e
.
preventDefault
();
_fn
.
build
.
form
.
zone
.
add
();
_fn
.
build
.
form
.
zone
.
add
();
// Set focus to first field of the new zone.
// Set focus to first field of the new zone.
$
(
'.zones-form .zone-row:last input[type=text]:first'
,
element
).
select
()
.
focus
()
;
$
(
'.zones-form .zone-row:last input[type=text]:first'
,
element
).
select
();
})
})
.
on
(
'click'
,
'.remove-zone'
,
_fn
.
build
.
form
.
zone
.
remove
)
.
on
(
'click'
,
'.remove-zone'
,
_fn
.
build
.
form
.
zone
.
remove
)
.
on
(
'input'
,
'.zone-row input'
,
_fn
.
build
.
form
.
zone
.
changedInputHandler
)
.
on
(
'input'
,
'.zone-row input'
,
_fn
.
build
.
form
.
zone
.
changedInputHandler
)
...
@@ -225,7 +228,7 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -225,7 +228,7 @@ function DragAndDropEditBlock(runtime, element, params) {
e
.
preventDefault
();
e
.
preventDefault
();
_fn
.
build
.
form
.
item
.
add
();
_fn
.
build
.
form
.
item
.
add
();
// Set focus to first field of the new item.
// Set focus to first field of the new item.
$
(
'.items-form .item:last input[type=text]:first'
,
element
).
select
()
.
focus
()
;
$
(
'.items-form .item:last input[type=text]:first'
,
element
).
select
();
})
})
.
on
(
'click'
,
'.remove-item'
,
_fn
.
build
.
form
.
item
.
remove
)
.
on
(
'click'
,
'.remove-item'
,
_fn
.
build
.
form
.
item
.
remove
)
.
on
(
'click'
,
'.advanced-link button'
,
_fn
.
build
.
form
.
item
.
showAdvancedSettings
)
.
on
(
'click'
,
'.advanced-link button'
,
_fn
.
build
.
form
.
item
.
showAdvancedSettings
)
...
...
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