diff --git a/lms/envs/common.py b/lms/envs/common.py index 0ade1fc18c..1462afcece 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -1272,6 +1272,7 @@ base_application_js = [ 'js/src/utility.js', 'js/src/logger.js', 'js/my_courses_dropdown.js', + 'js/dialog_tab_controls.js', 'js/src/string_utils.js', 'js/form.ext.js', 'js/src/ie_shim.js', diff --git a/lms/static/js/dialog_tab_controls.js b/lms/static/js/dialog_tab_controls.js new file mode 100644 index 0000000000..4316b859d8 --- /dev/null +++ b/lms/static/js/dialog_tab_controls.js @@ -0,0 +1,73 @@ +var DialogTabControls = (function() { + 'use strict'; + + var focusableChildren, + numElements, + currentIndex, + focusableElementSelectors = 'a, input[type=text], input[type=submit], select, textarea, button', + setCurrentIndex = function(currentElement) { + var elementIndex = focusableChildren.index(currentElement); + if (elementIndex >= 0) { + currentIndex = elementIndex; + } + }, + initializeTabKeyValues = function(elementName, $closeButton) { + focusableChildren = $(elementName).find(focusableElementSelectors); + if ($closeButton) { + focusableChildren = focusableChildren.add($closeButton); + } + numElements = focusableChildren.length; + currentIndex = 0; + focusableChildren[currentIndex].focus(); + focusableChildren.on('click', function() { + setCurrentIndex(this); + }); + }, + focusElement = function() { + var focusableElement = focusableChildren[currentIndex]; + if (focusableElement) { + focusableElement.focus(); + } + }, + focusPrevious = function() { + currentIndex--; + if (currentIndex < 0) { + currentIndex = numElements - 1; + } + + focusElement(); + }, + focusNext = function() { + currentIndex++; + if (currentIndex >= numElements) { + currentIndex = 0; + } + + focusElement(); + }, + setKeydownListener = function($element, $closeButton) { + $element.on('keydown', function(e) { + var keyCode = e.keyCode || e.which, + escapeKeyCode = 27, + tabKeyCode = 9; + if (keyCode === escapeKeyCode) { + e.preventDefault(); + if ($closeButton) { + $closeButton.click(); + } + } + if (keyCode === tabKeyCode && e.shiftKey) { + e.preventDefault(); + focusPrevious(); + } else if (keyCode === tabKeyCode) { + e.preventDefault(); + focusNext(); + } + }); + }; + + return { + initializeTabKeyValues: initializeTabKeyValues, + setKeydownListener: setKeydownListener + }; +}()); diff --git a/lms/static/sass/course/courseware/_courseware.scss b/lms/static/sass/course/courseware/_courseware.scss index 8f55e6a80c..56771c40a1 100644 --- a/lms/static/sass/course/courseware/_courseware.scss +++ b/lms/static/sass/course/courseware/_courseware.scss @@ -561,6 +561,14 @@ html.video-fullscreen { } } + section.xqa-modal, section.staff-modal, section.history-modal { + width: 80%; + height: 80%; + left: left(20%); + overflow: auto; + display: none; + } + div.staff_info { display: none; @include clearfix(); diff --git a/lms/static/sass/partials/base/_variables.scss b/lms/static/sass/partials/base/_variables.scss index cd083e7b45..d8da190786 100644 --- a/lms/static/sass/partials/base/_variables.scss +++ b/lms/static/sass/partials/base/_variables.scss @@ -380,7 +380,7 @@ $body-line-height: golden-ratio(.875em, 1) !default; $base-font-color: rgb(60,60,60) !default; $baseFontColor: $base-font-color; -$lighter-base-font-color: rgb(100,100,100) $base-font-color; +$lighter-base-font-color: rgb(100,100,100) !default; $very-light-text: rgb(255,255,255) !default; $text-color: rgb(51, 51, 51) !default; diff --git a/lms/templates/courseware/xqa_interface.html b/lms/templates/courseware/xqa_interface.html index 6fc5d8db15..b4a2fe4cc9 100644 --- a/lms/templates/courseware/xqa_interface.html +++ b/lms/templates/courseware/xqa_interface.html @@ -5,11 +5,19 @@ %endif diff --git a/lms/templates/staff_problem_info.html b/lms/templates/staff_problem_info.html index 8038a15e2d..82d4cb1b0c 100644 --- a/lms/templates/staff_problem_info.html +++ b/lms/templates/staff_problem_info.html @@ -31,7 +31,7 @@ ${block_content} % endif -