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
c7858200
Commit
c7858200
authored
Jan 15, 2016
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't preserve old size when saving changes; made it impossible to remove old fixed size
parent
ce054355
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
12 deletions
+0
-12
drag_and_drop_v2/public/js/drag_and_drop_edit.js
+0
-6
drag_and_drop_v2/templates/html/js_templates.html
+0
-6
No files found.
drag_and_drop_v2/public/js/drag_and_drop_edit.js
View file @
c7858200
...
@@ -429,18 +429,12 @@ function DragAndDropEditBlock(runtime, element, params) {
...
@@ -429,18 +429,12 @@ function DragAndDropEditBlock(runtime, element, params) {
correct
:
$el
.
find
(
'.success-feedback'
).
val
(),
correct
:
$el
.
find
(
'.success-feedback'
).
val
(),
incorrect
:
$el
.
find
(
'.error-feedback'
).
val
()
incorrect
:
$el
.
find
(
'.error-feedback'
).
val
()
},
},
size
:
{},
// old size data (preserved if present but ignored)
imageURL
:
imageURL
,
imageURL
:
imageURL
,
imageDescription
:
imageDescription
,
imageDescription
:
imageDescription
,
};
};
// Optional preferred width as a percentage of the bg image's width:
// Optional preferred width as a percentage of the bg image's width:
var
widthPercent
=
$el
.
find
(
'.item-width'
).
val
();
var
widthPercent
=
$el
.
find
(
'.item-width'
).
val
();
if
(
widthPercent
&&
+
widthPercent
>
0
)
{
data
.
widthPercent
=
widthPercent
;
}
if
(
widthPercent
&&
+
widthPercent
>
0
)
{
data
.
widthPercent
=
widthPercent
;
}
// Item width/height in pixels are now ignored, but preserve the data:
var
width
=
$el
.
find
(
'.item-pixel-width'
).
val
();
if
(
width
&&
+
width
>
0
)
{
data
.
size
.
width
=
(
+
width
)
+
'px'
;
}
var
height
=
$el
.
find
(
'.item-pixel-height'
).
val
();
if
(
height
&&
+
height
>
0
)
{
data
.
size
.
height
=
(
+
height
)
+
'px'
;
}
var
numValue
=
parseFloat
(
$el
.
find
(
'.item-numerical-value'
).
val
());
var
numValue
=
parseFloat
(
$el
.
find
(
'.item-numerical-value'
).
val
());
var
numMargin
=
parseFloat
(
$el
.
find
(
'.item-numerical-margin'
).
val
());
var
numMargin
=
parseFloat
(
$el
.
find
(
'.item-numerical-margin'
).
val
());
...
...
drag_and_drop_v2/templates/html/js_templates.html
View file @
c7858200
...
@@ -98,12 +98,6 @@
...
@@ -98,12 +98,6 @@
<
div
class
=
"row advanced"
>
<
div
class
=
"row advanced"
>
<
label
for
=
"item-{{id}}-width-percent"
>
{{
i18n
"Preferred width as a percentage of the background image width (or blank for automatic width):"
}}
<
/label
>
<
label
for
=
"item-{{id}}-width-percent"
>
{{
i18n
"Preferred width as a percentage of the background image width (or blank for automatic width):"
}}
<
/label
>
<
input
type
=
"number"
id
=
"item-{{id}}-width-percent"
class
=
"item-width"
value
=
"{{ singleDecimalFloat widthPercent }}"
step
=
"0.1"
min
=
"1"
max
=
"99"
/>%
<
input
type
=
"number"
id
=
"item-{{id}}-width-percent"
class
=
"item-width"
value
=
"{{ singleDecimalFloat widthPercent }}"
step
=
"0.1"
min
=
"1"
max
=
"99"
/>%
<!--
A
fixed
pixel
width
/
height
is
no
longer
used
,
so
they
are
now
hidden
,
but
we
are
preserving
the
existing
data
:
-->
<
input
type
=
"hidden"
class
=
"item-pixel-width"
value
=
"{{ pixelWidth }}"
/>
<
input
type
=
"hidden"
class
=
"item-pixel-height"
value
=
"{{ pixelHeight }}"
/>
<
/div
>
<
/div
>
<
div
class
=
"row advanced"
>
<
div
class
=
"row advanced"
>
<
label
for
=
"item-{{id}}-numerical-value"
>
<
label
for
=
"item-{{id}}-numerical-value"
>
...
...
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