Merge pull request #14421 from edx/christina/wiki
Wiki accessibility fixes.
This commit is contained in:
@@ -10,6 +10,12 @@ $(document).ready(function() {
|
||||
// Store the inital contents so we can compare for unsaved changes
|
||||
var initial_contents = editor.getValue();
|
||||
|
||||
// The Wiki associates a label with the text area that has ID "id_content". However, when we swap in
|
||||
// CodeMirror, that text area is hidden. We need to associate the label with visible CodeMirror text area
|
||||
// (and there is JS code in the wiki that depends on "id_content" interact with the content, so we have
|
||||
// to leave that alone).
|
||||
editor.getInputField().setAttribute('id', 'id_codemirror_content');
|
||||
$(".control-label[for='id_content']")[0].setAttribute('for', 'id_codemirror_content');
|
||||
window.onbeforeunload = function askConfirm() { // Warn the user before they navigate away
|
||||
if (editor.getValue() != initial_contents) {
|
||||
return 'You have made changes to the article that have not been saved yet.';
|
||||
|
||||
Reference in New Issue
Block a user