Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-activetable
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
xblock-activetable
Commits
5125445e
Commit
5125445e
authored
Dec 07, 2015
by
Sven Marnach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address Mark's review notes.
parent
b8548d96
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
9 deletions
+13
-9
activetable/activetable.py
+1
-1
activetable/static/js/src/activetable.js
+4
-2
activetable/templates/html/activetable.html
+8
-6
No files found.
activetable/activetable.py
View file @
5125445e
...
...
@@ -153,7 +153,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
row
[
'class'
]
=
'even'
else
:
row
[
'class'
]
=
'odd'
for
cell
in
row
[
'cells'
]
:
for
cell
,
cell
.
col_label
in
zip
(
row
[
'cells'
],
self
.
thead
)
:
cell
.
id
=
'cell_{}_{}'
.
format
(
row
[
'index'
],
cell
.
index
)
cell
.
classes
=
''
if
not
cell
.
is_static
:
...
...
activetable/static/js/src/activetable.js
View file @
5125445e
...
...
@@ -84,9 +84,11 @@ function ActiveTableXBlock(runtime, element, init_args) {
}
function
toggleHelp
(
e
)
{
var
$help_text
=
$
(
'#activetable-help-text'
,
element
);
var
$help_text
=
$
(
'#activetable-help-text'
,
element
)
,
visible
;
$help_text
.
toggle
();
$
(
this
).
text
(
$help_text
.
is
(
':visible'
)
?
'-help'
:
'+help'
);
visible
=
$help_text
.
is
(
':visible'
);
$
(
this
).
text
(
visible
?
'-help'
:
'+help'
);
$
(
this
).
attr
(
'aria-expanded'
,
visible
);
}
$
(
'#activetable-help-button'
,
element
).
click
(
toggleHelp
);
...
...
activetable/templates/html/activetable.html
View file @
5125445e
<div
class=
"activetable_block"
>
{% if help_text %}
<div
class=
"activetable-help"
style=
"width: {{ total_width }}px;"
>
<button
id=
"activetable-help-button"
>
+help
</button>
<button
id=
"activetable-help-button"
aria-controls=
"activetable-help-text"
aria-haspopup=
"true"
aria-expanded=
"false"
>
+help
</button>
<p
id=
"activetable-help-text"
>
{{ help_text }}
</p>
</div>
{% endif %}
...
...
@@ -12,7 +13,7 @@
</colgroup>
<thead>
<tr
style=
"height: {{ head_height }}px;"
>
{% for cell in thead %}
<th>
{{ cell }}
</th>
{% endfor %}
{% for cell in thead %}
<th
scope=
"col"
>
{{ cell }}
</th>
{% endfor %}
</tr>
</thead>
<tbody>
...
...
@@ -23,7 +24,8 @@
{% if cell.is_static %}
{{ cell.value }}
{% else %}
<input
type=
"text"
style=
"height: {{ cell.height }}px;"
size=
1
<label
class=
"sr"
for=
"input_{{ cell.id }}"
>
{{ cell.col_label }}
</label>
<input
id=
"input_{{ cell.id }}"
type=
"text"
style=
"height: {{ cell.height }}px;"
size=
1
value=
"{{ cell.value|default_if_none:'' }}"
placeholder=
"{{ cell.placeholder }}"
>
{% endif %}
</td>
...
...
@@ -35,13 +37,13 @@
{% else %}
<p>
This component isn't configured properly and can't be displayed.
</p>
{% endif %}
<p
class=
"status"
></p>
<div
class=
"status-message"
></div>
<p
class=
"status"
aria-live=
"polite"
></p>
<div
class=
"status-message"
aria-live=
"polite"
></div>
<div
class=
"action"
>
<button
class=
"check"
><span
class=
"check-label"
>
Check
</span><span
class=
"sr"
>
your answer
</span></button>
{% if max_attempts %}
<button
class=
"save"
>
Save
<span
class=
"sr"
>
your answer
</span></button>
<div
class=
"submission-feedback"
></div>
<div
class=
"submission-feedback"
aria-live=
"polite"
></div>
{% endif %}
</div>
</div>
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