Skip to content
Snippets Groups Projects
Commit ed76e404 authored by Kathrin Osswald's avatar Kathrin Osswald
Browse files

Improved catching shortcuts feature again to prevent catching when editable content is focused.

parent 20534c43
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,10 @@ moodle-theme_boost_campus ...@@ -4,6 +4,10 @@ moodle-theme_boost_campus
Changes Changes
------- -------
### Unreleased
* 2017-10-16 - Improved catching shortcuts feature again to prevent catching when editable content is focused.
### Release v3.2-r4 ### Release v3.2-r4
* 2017-09-25 - Improved catching shortcuts feature to prevent the catching when form elements are focused. * 2017-09-25 - Improved catching shortcuts feature to prevent the catching when form elements are focused.
......
define(["jquery"],function(a){"use strict";function b(b){"end"==b&&a(document).keydown(function(a){35==a.keyCode&&1!=d()&&c(a)}),navigator.appVersion.indexOf("Mac")!=-1&&"cmdarrowdown"==b&&a(document).keydown(function(a){40==a.keyCode&&a.metaKey&&1!=d()&&c(a)}),navigator.appVersion.indexOf("Win")!=-1&&"ctrlarrowdown"==b&&a(document).keydown(function(a){40==a.keyCode&&a.ctrlKey&&1!=d()&&c(a)})}function c(b){b.preventDefault(),a("html, body").animate({scrollTop:a("#page-footer").offset().top-a(window).height()+50},500)}function d(){var a=document.activeElement.tagName,b=!1;return"INPUT"!=a&&"TEXTAREA"!=a||(b=!0),b}return{init:function(a){for(var c=0,d=a.length;c<d;c++)b(a[c])}}}); define(["jquery"],function(a){"use strict";function b(b){"end"==b&&a(document).keydown(function(a){35==a.keyCode&&1!=d()&&c(a)}),navigator.appVersion.indexOf("Mac")!=-1&&"cmdarrowdown"==b&&a(document).keydown(function(a){40==a.keyCode&&a.metaKey&&1!=d()&&c(a)}),navigator.appVersion.indexOf("Win")!=-1&&"ctrlarrowdown"==b&&a(document).keydown(function(a){40==a.keyCode&&a.ctrlKey&&1!=d()&&c(a)})}function c(b){b.preventDefault(),a("html, body").animate({scrollTop:a("#page-footer").offset().top-a(window).height()+50},500)}function d(){var a=document.activeElement,b=!1;return"INPUT"!=a.tagName&&"TEXTAREA"!=a.tagName&&1!=a.isContentEditable||(b=!0),b}return{init:function(a){for(var c=0,d=a.length;c<d;c++)b(a[c])}}});
\ No newline at end of file \ No newline at end of file
...@@ -91,10 +91,10 @@ define(['jquery'], function($) { ...@@ -91,10 +91,10 @@ define(['jquery'], function($) {
*/ */
function checkForActiveFormElement() { function checkForActiveFormElement() {
// Get the active Element for the current page. // Get the active Element for the current page.
var activeElement = document.activeElement.tagName; var activeElement = document.activeElement;
var returnvalue = false; var returnvalue = false;
// Check if the given active element is an input field or a textarea. // Check if the given active element is type of input field, textarea or editable content.
if (activeElement == 'INPUT' || activeElement == 'TEXTAREA') { if (activeElement.tagName == 'INPUT' || activeElement.tagName == 'TEXTAREA' || activeElement.isContentEditable == true) {
returnvalue = true; returnvalue = true;
} }
return returnvalue; return returnvalue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment