hide the whiteboard toolbar when over the presentation controlbar

This commit is contained in:
Chad Pilkey 2013-04-25 08:44:21 -07:00
parent f62f66c451
commit 88dea837e4

View File

@ -60,28 +60,31 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:Script>
<![CDATA[
import flash.ui.Keyboard;
import mx.events.MoveEvent;
import mx.events.ResizeEvent;
import mx.managers.CursorManager;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.events.MadePresenterEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.modules.present.events.PresentationEvent;
import org.bigbluebutton.modules.present.ui.views.PresentationWindow;
import org.bigbluebutton.modules.whiteboard.business.shapes.DrawObject;
import org.bigbluebutton.modules.whiteboard.business.shapes.GraphicObject;
import org.bigbluebutton.modules.whiteboard.business.shapes.TextObject;
import org.bigbluebutton.modules.whiteboard.business.shapes.WhiteboardConstants;
import org.bigbluebutton.modules.whiteboard.events.GraphicObjectFocusEvent;
import org.bigbluebutton.modules.whiteboard.events.StopWhiteboardModuleEvent;
import org.bigbluebutton.modules.whiteboard.events.ToggleGridEvent;
import org.bigbluebutton.modules.whiteboard.events.WhiteboardButtonEvent;
import org.bigbluebutton.modules.whiteboard.events.WhiteboardDrawEvent;
import org.bigbluebutton.modules.whiteboard.events.WhiteboardPresenterEvent;
import mx.containers.ControlBar;
import mx.events.MoveEvent;
import mx.events.ResizeEvent;
import mx.managers.CursorManager;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.core.managers.UserManager;
import org.bigbluebutton.main.events.MadePresenterEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.modules.present.events.PresentationEvent;
import org.bigbluebutton.modules.present.ui.views.PresentationWindow;
import org.bigbluebutton.modules.present.ui.views.SlideView;
import org.bigbluebutton.modules.whiteboard.business.shapes.DrawObject;
import org.bigbluebutton.modules.whiteboard.business.shapes.GraphicObject;
import org.bigbluebutton.modules.whiteboard.business.shapes.TextObject;
import org.bigbluebutton.modules.whiteboard.business.shapes.WhiteboardConstants;
import org.bigbluebutton.modules.whiteboard.events.GraphicObjectFocusEvent;
import org.bigbluebutton.modules.whiteboard.events.StopWhiteboardModuleEvent;
import org.bigbluebutton.modules.whiteboard.events.ToggleGridEvent;
import org.bigbluebutton.modules.whiteboard.events.WhiteboardButtonEvent;
import org.bigbluebutton.modules.whiteboard.events.WhiteboardDrawEvent;
import org.bigbluebutton.modules.whiteboard.events.WhiteboardPresenterEvent;
import org.bigbluebutton.modules.whiteboard.events.WhiteboardSettingResetEvent;
import org.bigbluebutton.modules.whiteboard.views.models.WhiteboardOptions;
import org.bigbluebutton.util.i18n.ResourceUtil;
@ -220,8 +223,32 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
//presentationWindow.addEventListener(MoveEvent.MOVE, setPositionAndDepth);
//presentationWindow.addEventListener(ResizeEvent.RESIZE, setPositionAndDepth);
//presentationWindow.addEventListener(MouseEvent.CLICK, setPositionAndDepth);
presentationWindow.addEventListener(MouseEvent.ROLL_OVER, showToolbar);
presentationWindow.addEventListener(MouseEvent.ROLL_OUT, hideToolbar);
var curChild:Object = window.getChildByName("presCtrlBar");
if (curChild) {
curChild.addEventListener(MouseEvent.ROLL_OVER, hideToolbar);
curChild.addEventListener(MouseEvent.ROLL_OUT, showToolbar);
} else {
LogUtil.debug("CHAD: presCtrlBar not found, numChildren " + window.numChildren);
}
window.presCtrlBar.addEventListener(MouseEvent.ROLL_OVER, hideToolbar);
window.presCtrlBar.addEventListener(MouseEvent.ROLL_OUT, showToolbar);
/*
for (var i:int =0; i < window.numChildren; i++) {
curChild = window.getChildAt(i);
if (curChild.) {
LogUtil.debug("CHAD: found control bar and attached");
curChild.addEventListener(MouseEvent.ROLL_OVER, hideToolbar);
curChild.addEventListener(MouseEvent.ROLL_OUT, showToolbar);
}
}
*/
window.addEventListener(MouseEvent.ROLL_OVER, showToolbar);
window.addEventListener(MouseEvent.ROLL_OUT, hideToolbar);
this.addEventListener(MouseEvent.ROLL_OVER, showToolbar);
this.addEventListener(MouseEvent.ROLL_OUT, hideToolbar);
@ -239,17 +266,22 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function closeToolbar(e:StopWhiteboardModuleEvent):void {
parent.removeChild(this);
}
private function showToolbar(e:MouseEvent):void {
if (toolbarAllowed()) {
setPositionAndDepth();
showWhiteboardToolbar = true;
}
}
private function hideToolbar(e:MouseEvent = null):void {
showWhiteboardToolbar = false;
}
private function showToolbar(e:MouseEvent):void {
if (toolbarAllowed()) {
setPositionAndDepth();
showWhiteboardToolbar = true;
}
if (e)
LogUtil.debug("CHAD: mouse over: " + e.target);
}
private function hideToolbar(e:MouseEvent = null):void {
showWhiteboardToolbar = false;
if (e)
LogUtil.debug("CHAD: mouse out: " + e.target);
}
private function graphicObjSelected(event:GraphicObjectFocusEvent):void {
var gobj:GraphicObject = event.data;