MDL-44081 assign: Fix Grader annotation button accessibility ordering

This commit is contained in:
Zig Tan 2018-06-27 15:50:31 +08:00
parent 543005a342
commit 749c7cc5a9
2 changed files with 20 additions and 16 deletions

View file

@ -159,46 +159,46 @@ class assignfeedback_editpdf_renderer extends plugin_renderer_base {
$navigation3 .= $this->render_toolbar_button('comment_expcol', 'expcolcomments', $this->get_shortcut('expcolcomments')); $navigation3 .= $this->render_toolbar_button('comment_expcol', 'expcolcomments', $this->get_shortcut('expcolcomments'));
$navigation3 = html_writer::div($navigation3, 'navigation-expcol', array('role' => 'navigation')); $navigation3 = html_writer::div($navigation3, 'navigation-expcol', array('role' => 'navigation'));
$toolbar1 = ''; $toolbargroup = '';
$toolbar2 = '';
$toolbar3 = '';
$toolbar4 = '';
$clearfix = html_writer::div('', 'clearfix'); $clearfix = html_writer::div('', 'clearfix');
if (!$widget->readonly) { if (!$widget->readonly) {
// Comments. // Comments.
$toolbar1 = '';
$toolbar1 .= $this->render_toolbar_button('comment', 'comment', $this->get_shortcut('comment')); $toolbar1 .= $this->render_toolbar_button('comment', 'comment', $this->get_shortcut('comment'));
$toolbar1 .= $this->render_toolbar_button('background_colour_clear', 'commentcolour', $this->get_shortcut('commentcolour')); $toolbar1 .= $this->render_toolbar_button('background_colour_clear', 'commentcolour', $this->get_shortcut('commentcolour'));
$toolbar1 = html_writer::div($toolbar1, 'toolbar', array('role'=>'toolbar')); $toolbar1 = html_writer::div($toolbar1, 'toolbar', array('role' => 'toolbar'));
// Select Tool. // Select Tool.
$toolbar2 = '';
$toolbar2 .= $this->render_toolbar_button('drag', 'drag', $this->get_shortcut('drag')); $toolbar2 .= $this->render_toolbar_button('drag', 'drag', $this->get_shortcut('drag'));
$toolbar2 .= $this->render_toolbar_button('select', 'select', $this->get_shortcut('select')); $toolbar2 .= $this->render_toolbar_button('select', 'select', $this->get_shortcut('select'));
$toolbar2 = html_writer::div($toolbar2, 'toolbar', array('role'=>'toolbar')); $toolbar2 = html_writer::div($toolbar2, 'toolbar', array('role' => 'toolbar'));
// Other Tools. // Other Tools.
$toolbar3 = $this->render_toolbar_button('pen', 'pen', $this->get_shortcut('pen')); $toolbar3 = '';
$toolbar3 .= $this->render_toolbar_button('pen', 'pen', $this->get_shortcut('pen'));
$toolbar3 .= $this->render_toolbar_button('line', 'line', $this->get_shortcut('line')); $toolbar3 .= $this->render_toolbar_button('line', 'line', $this->get_shortcut('line'));
$toolbar3 .= $this->render_toolbar_button('rectangle', 'rectangle', $this->get_shortcut('rectangle')); $toolbar3 .= $this->render_toolbar_button('rectangle', 'rectangle', $this->get_shortcut('rectangle'));
$toolbar3 .= $this->render_toolbar_button('oval', 'oval', $this->get_shortcut('oval')); $toolbar3 .= $this->render_toolbar_button('oval', 'oval', $this->get_shortcut('oval'));
$toolbar3 .= $this->render_toolbar_button('highlight', 'highlight', $this->get_shortcut('highlight')); $toolbar3 .= $this->render_toolbar_button('highlight', 'highlight', $this->get_shortcut('highlight'));
$toolbar3 .= $this->render_toolbar_button('background_colour_clear', 'annotationcolour', $this->get_shortcut('annotationcolour')); $toolbar3 .= $this->render_toolbar_button('background_colour_clear', 'annotationcolour', $this->get_shortcut('annotationcolour'));
$toolbar3 = html_writer::div($toolbar3, 'toolbar', array('role'=>'toolbar')); $toolbar3 = html_writer::div($toolbar3, 'toolbar', array('role' => 'toolbar'));
// Stamps. // Stamps.
$toolbar4 .= $this->render_toolbar_button('stamp', 'stamp', 'n'); $toolbar4 = '';
$toolbar4 .= $this->render_toolbar_button('stamp', 'stamp', $this->get_shortcut('stamp'));
$toolbar4 .= $this->render_toolbar_button('background_colour_clear', 'currentstamp', $this->get_shortcut('currentstamp')); $toolbar4 .= $this->render_toolbar_button('background_colour_clear', 'currentstamp', $this->get_shortcut('currentstamp'));
$toolbar4 = html_writer::div($toolbar4, 'toolbar', array('role'=>'toolbar')); $toolbar4 = html_writer::div($toolbar4, 'toolbar', array('role'=>'toolbar'));
// Add toolbars to toolbar_group in order of display, and float the toolbar_group right.
$toolbars = $toolbar1 . $toolbar2 . $toolbar3 . $toolbar4;
$toolbargroup = html_writer::div($toolbars, 'toolbar_group', array('role' => 'toolbar_group'));
} }
// Toobars written in reverse order because they are floated right.
$pageheader = html_writer::div($navigation1 . $pageheader = html_writer::div($navigation1 .
$navigation2 . $navigation2 .
$navigation3 . $navigation3 .
$toolbar4 . $toolbargroup .
$toolbar3 .
$toolbar2 .
$toolbar1 .
$clearfix, $clearfix,
'pageheader'); 'pageheader');
$body = $pageheader; $body = $pageheader;

View file

@ -176,6 +176,10 @@
float: left; float: left;
} }
.assignfeedback_editpdf_widget .toolbar_group {
float: right;
}
.assignfeedback_editpdf_widget .toolbar button { .assignfeedback_editpdf_widget .toolbar button {
box-shadow: none; box-shadow: none;
-moz-box-shadow: none; -moz-box-shadow: none;
@ -183,7 +187,7 @@
} }
.assignfeedback_editpdf_widget .toolbar { .assignfeedback_editpdf_widget .toolbar {
float: right; float: left;
} }
.assignfeedback_editpdf_widget .navigation, .assignfeedback_editpdf_widget .navigation,