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
74a0e79a
Commit
74a0e79a
authored
Dec 13, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide width/height fields in Studio but keep existing data.
parent
e8708605
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
drag_and_drop_v2/public/js/drag_and_drop_edit.js
+3
-1
drag_and_drop_v2/templates/html/js_templates.html
+9
-1
No files found.
drag_and_drop_v2/public/js/drag_and_drop_edit.js
View file @
74a0e79a
...
@@ -330,7 +330,8 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -330,7 +330,8 @@ function DragAndDropEditBlock(runtime, element, params) {
ctx
.
dropdown
=
_fn
.
build
.
form
.
createDropdown
(
ctx
.
zone
);
ctx
.
dropdown
=
_fn
.
build
.
form
.
createDropdown
(
ctx
.
zone
);
if
(
!
oldItem
)
ctx
.
width
=
'190'
;
// Item width/height are ignored, but preserve the data:
if
(
!
oldItem
)
ctx
.
width
=
'0'
;
else
ctx
.
width
=
oldItem
.
size
.
width
.
substr
(
0
,
else
ctx
.
width
=
oldItem
.
size
.
width
.
substr
(
0
,
oldItem
.
size
.
width
.
length
-
2
);
oldItem
.
size
.
width
.
length
-
2
);
if
(
ctx
.
width
==
'au'
)
ctx
.
width
=
'0'
;
if
(
ctx
.
width
==
'au'
)
ctx
.
width
=
'0'
;
...
@@ -385,6 +386,7 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -385,6 +386,7 @@ function DragAndDropEditBlock(runtime, element, params) {
backgroundImage
=
$el
.
find
(
'.background-image'
).
val
();
backgroundImage
=
$el
.
find
(
'.background-image'
).
val
();
if
(
name
.
length
>
0
||
backgroundImage
.
length
>
0
)
{
if
(
name
.
length
>
0
||
backgroundImage
.
length
>
0
)
{
// Item width/height are ignored, but preserve the data:
var
width
=
$el
.
find
(
'.item-width'
).
val
(),
var
width
=
$el
.
find
(
'.item-width'
).
val
(),
height
=
$el
.
find
(
'.item-height'
).
val
();
height
=
$el
.
find
(
'.item-height'
).
val
();
...
...
drag_and_drop_v2/templates/html/js_templates.html
View file @
74a0e79a
...
@@ -56,7 +56,15 @@
...
@@ -56,7 +56,15 @@
<
label
>
{{
i18n
"Error Feedback"
}}
<
/label
>
<
label
>
{{
i18n
"Error Feedback"
}}
<
/label
>
<
textarea
class
=
"error-feedback"
>
{{
feedback
.
incorrect
}}
<
/textarea
>
<
textarea
class
=
"error-feedback"
>
{{
feedback
.
incorrect
}}
<
/textarea
>
<
/div
>
<
/div
>
<
div
class
=
"row"
>
<
div
class
=
"row"
style
=
"display: none;"
>
<!--
width
and
height
are
no
longer
respected
,
so
they
are
now
hidden
,
but
we
are
keeping
the
HTML
and
JS
code
intact
so
that
the
existing
data
will
be
preserved
until
we
can
be
sure
that
removing
the
width
/
height
is
OK
for
all
courses
that
use
this
block
.
If
we
do
add
them
back
in
,
we
should
only
allow
setting
"width"
.
Height
will
be
detected
automatically
based
on
font
/
image
size
requirements
.
-->
<
label
>
{{
i18n
"Width in pixels (0 for auto)"
}}
<
/label
>
<
label
>
{{
i18n
"Width in pixels (0 for auto)"
}}
<
/label
>
<
input
type
=
"text"
class
=
"item-width"
value
=
"{{ width }}"
><
/input
>
<
input
type
=
"text"
class
=
"item-width"
value
=
"{{ width }}"
><
/input
>
<
label
>
{{
i18n
"Height in pixels (0 for auto)"
}}
<
/label
>
<
label
>
{{
i18n
"Height in pixels (0 for auto)"
}}
<
/label
>
...
...
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