You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2019/03/02 07:20:38 UTC

[openmeetings] branch OPENMEETINGS-1986-backspace created (now 79cc290)

This is an automated email from the ASF dual-hosted git repository.

solomax pushed a change to branch OPENMEETINGS-1986-backspace
in repository https://gitbox.apache.org/repos/asf/openmeetings.git.


      at 79cc290  [OPENMEETINGS-1986] initial attempt to prevent browser back in the room

This branch includes the following new commits:

     new 79cc290  [OPENMEETINGS-1986] initial attempt to prevent browser back in the room

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[openmeetings] 01/01: [OPENMEETINGS-1986] initial attempt to prevent browser back in the room

Posted by so...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch OPENMEETINGS-1986-backspace
in repository https://gitbox.apache.org/repos/asf/openmeetings.git

commit 79cc2908d7fa27628594f330733e486e73edf414
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Sat Mar 2 14:20:20 2019 +0700

    [OPENMEETINGS-1986] initial attempt to prevent browser back in the room
---
 .../java/org/apache/openmeetings/web/room/wb/raw-wb-area.js  | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
index 2aac871..1a6ef27 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/wb/raw-wb-area.js
@@ -88,6 +88,16 @@ var DrawWbArea = function() {
 		}));
 		return false;
 	}
+	function _preventKeydown(e) {
+		if ('BODY' === e.target.tagName) {
+			switch (e.which) {
+				case 8:  // backspace
+					e.preventDefault();
+					e.stopImmediatePropagation();
+					return false;
+			}
+		}
+	}
 	function _deleteHandler(e) {
 		if ('BODY' === e.target.tagName) {
 			switch (e.which) {
@@ -391,11 +401,13 @@ var DrawWbArea = function() {
 	};
 	self.initVideos = _initVideos;
 	self.addDeleteHandler = function() {
+		$(window).keydown(_preventKeydown);
 		if (role === PRESENTER) {
 			$(window).keyup(_deleteHandler);
 		}
 	};
 	self.removeDeleteHandler = function() {
+		$(window).off('keydown', _preventKeydown);
 		$(window).off('keyup', _deleteHandler);
 	};
 	self.updateAreaClass = function() {};