From 9804f73e366760fff8fac8e863b65ce04958aed0 Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 15 Sep 2016 16:40:23 -0400 Subject: [PATCH 1/2] Revert "Fixed focus should remain within the simulated dialogs." This reverts commit ae849406bf5d59a29dbb5f78ea07a7b54529a303. --- lms/envs/common.py | 1 - lms/static/js/dialog_tab_controls.js | 67 ------------------- .../sass/course/courseware/_courseware.scss | 8 --- lms/templates/courseware/xqa_interface.html | 39 +---------- lms/templates/help_modal.html | 63 +++++++++++++++-- lms/templates/staff_problem_info.html | 16 ++--- 6 files changed, 68 insertions(+), 126 deletions(-) delete mode 100644 lms/static/js/dialog_tab_controls.js diff --git a/lms/envs/common.py b/lms/envs/common.py index 94c01207ac..f70d2d4d24 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -1278,7 +1278,6 @@ 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 deleted file mode 100644 index e46bac80cd..0000000000 --- a/lms/static/js/dialog_tab_controls.js +++ /dev/null @@ -1,67 +0,0 @@ -var DialogTabControls = (function() { - 'use strict'; - - var focusableChildren, - numElements, - currentIndex, - initializeTabKeyValues = function(elementName, $closeButton) { - focusableChildren = $(elementName).find( - 'a, input[type=text], input[type=submit], select, textarea, button' - ); - if ($closeButton) { - focusableChildren = focusableChildren.add($closeButton); - } - numElements = focusableChildren.length; - currentIndex = 0; - focusableChildren[currentIndex].focus(); - }, - focusElement = function() { - var focusableElement = focusableChildren[currentIndex]; - if (focusableElement) { - focusableElement.focus(); - } - }, - focusPrevious = function() { - currentIndex--; - if (currentIndex < 0) { - currentIndex = numElements - 1; - } - - focusElement(); - - return false; - }, - focusNext = function() { - currentIndex++; - if (currentIndex >= numElements) { - currentIndex = 0; - } - - focusElement(); - - return false; - }, - setKeydownListner = function($modal, $closeButton) { - $modal.on('keydown', function(e) { - var keyCode = e.keyCode || e.which, - escapeKeyCode = 27, - tabKeyCode = 9; - if (keyCode === escapeKeyCode) { - e.preventDefault(); - $closeButton.click(); - } - if (keyCode === tabKeyCode && e.shiftKey) { - e.preventDefault(); - focusPrevious(); - } else if (keyCode === tabKeyCode) { - e.preventDefault(); - focusNext(); - } - }); - }; - - return { - initializeTabKeyValues: initializeTabKeyValues, - setKeydownListner: setKeydownListner - }; -}()); diff --git a/lms/static/sass/course/courseware/_courseware.scss b/lms/static/sass/course/courseware/_courseware.scss index 6b6b61d9ae..e0461ca2c6 100644 --- a/lms/static/sass/course/courseware/_courseware.scss +++ b/lms/static/sass/course/courseware/_courseware.scss @@ -561,14 +561,6 @@ 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/templates/courseware/xqa_interface.html b/lms/templates/courseware/xqa_interface.html index eb550cbfc7..6fc5d8db15 100644 --- a/lms/templates/courseware/xqa_interface.html +++ b/lms/templates/courseware/xqa_interface.html @@ -5,19 +5,11 @@ %endif diff --git a/lms/templates/staff_problem_info.html b/lms/templates/staff_problem_info.html index 82d4cb1b0c..8038a15e2d 100644 --- a/lms/templates/staff_problem_info.html +++ b/lms/templates/staff_problem_info.html @@ -31,7 +31,7 @@ ${block_content} % endif -