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 2018/08/07 06:07:52 UTC

[openmeetings] branch 4.0.x updated: [OPENMEETINGS-1908] activateWb is baing explicitly called on add remove Wb

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

solomax pushed a commit to branch 4.0.x
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/4.0.x by this push:
     new b23bdd5  [OPENMEETINGS-1908] activateWb is baing explicitly called on add remove Wb
b23bdd5 is described below

commit b23bdd58e375130f8f860bc5b88da55ab20b4140
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Tue Aug 7 13:07:43 2018 +0700

    [OPENMEETINGS-1908] activateWb is baing explicitly called on add remove Wb
---
 .../apache/openmeetings/web/room/wb/raw-wb-area.js  | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

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 47b59ba..6886efd 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
@@ -152,6 +152,9 @@ var DrawWbArea = function() {
 			$(this).data().setRole(role);
 		});
 	}
+	function _actionActivateWb(_wbId) {
+		wbAction('activateWb', JSON.stringify({wbId: _wbId}));
+	}
 	self.init = function() {
 		container = $('.room.wb.area');
 		tabs = container.find('.tabs');
@@ -167,7 +170,7 @@ var DrawWbArea = function() {
 			, activate: function(e, ui) {
 				//only send `activateWb` event if activation was initiated by user
 				if (e.originalEvent && e.originalEvent.type === 'click') {
-					wbAction('activateWb', JSON.stringify({wbId: ui.newTab.data('wb-id')}));
+					_actionActivateWb(ui.newTab.data('wb-id'));
 				}
 			}
 		});
@@ -233,6 +236,7 @@ var DrawWbArea = function() {
 		if (!_inited) return;
 		self.create(obj);
 		_activateTab(obj.wbId);
+		_actionActivateWb(obj.wbId);
 	};
 	self.activateWb = function(obj) {
 		if (!_inited) return;
@@ -242,6 +246,14 @@ var DrawWbArea = function() {
 		if (!_inited) return;
 		_renameTab(obj);
 	}
+	self.removeWb = function(obj) {
+		if (!_inited) return;
+		const tabId = self.getWbTabId(obj.wbId);
+		_getWbTab(obj.wbId).remove();
+		$('#' + tabId).remove();
+		refreshTabs();
+		_actionActivateWb(getActive().data().id);
+	};
 	self.load = function(json) {
 		if (!_inited) return;
 		self.getWb(json.wbId).load(json.obj);
@@ -271,13 +283,6 @@ var DrawWbArea = function() {
 		if (!_inited) return;
 		self.getWb(json.wbId).clearSlide(json.slide);
 	};
-	self.removeWb = function(obj) {
-		if (!_inited) return;
-		const tabId = self.getWbTabId(obj.wbId);
-		_getWbTab(obj.wbId).remove();
-		$('#' + tabId).remove();
-		refreshTabs();
-	};
 	self.resize = function(sbW, chW, w, h) {
 		const hh = h - 5;
 		container.width(w).height(h).css('left', (Settings.isRtl ? chW : sbW) + 'px');