Commit b51bdf0b authored by Dave Lane's avatar Dave Lane

some tweaks to fix broken keyboard nav

parent 30461770
/* created by Dave Lane, dave@oerfoundation.org, https://oeru.org */
var ORE_DEBUG = false; // set to false to disable debugging
var ORE_DEBUG = true; // set to false to disable debugging
function LOG() { if (ORE_DEBUG) { console.log.apply(this, arguments); }}
LOG('ORE DEBUG =', ORE_DEBUG); // only prints if DEBUG = true
// jQuery selectors and related functions in that context
......@@ -500,7 +500,9 @@ jQuery(document).ready(function() {
close_dialog();
clear_hash();
} else {
busy();
handle_action(action);
not_busy();
}
});
// handle links
......@@ -510,7 +512,9 @@ jQuery(document).ready(function() {
if (current_focus.hasClass('ore-button')) {
action = action_from_id(e.currentTarget.id);
LOG('executing action ', action);
busy();
handle_action(action);
not_busy();
} else {
LOG('just forwarding on the click...');
e.preventDefault();
......@@ -544,8 +548,8 @@ jQuery(document).ready(function() {
} else if (current_focus.hasClass('ore-button')) {
LOG('a button is focused');
}
current_focus.click();
}
current_focus.click();
}
});
......@@ -555,17 +559,16 @@ jQuery(document).ready(function() {
var orig_action = action;
// check if there's a form that needs processing
if (action == 'log_out') {
busy();
LOG('logging user out');
log_out(action);
not_busy();
busy();
return;
}
if (process_form(action)) {
LOG('processed form for ', action);
not_busy();
return;
}
if (ore_data.dialogs.hasOwnProperty(action)) {
LOG('orig action '+orig_action+' and new action '+action);
if (create_dialog(action)) {
......@@ -576,6 +579,7 @@ jQuery(document).ready(function() {
} else {
LOG('unknown button clicked!');
}
not_busy();
//LOG('failed to processes form for ', action);
// if no form, or after it's processed, take further action
//return;
......@@ -951,6 +955,7 @@ jQuery(document).ready(function() {
// do special stuff for changes that have an impact on what
// the user is allowed to see on the site...
if (action == 'login' || action == 'edit_profile' || action == 'enrol' || action == 'leave') {
busy();
LOG('Reloading page for completed action: ', action);
reload(ore_data.dialogs[action].default.success);
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment