Merge branch 'mood-menu' of github.com:pedrobmarin/bigbluebutton into mconf
This commit is contained in:
commit
8dca32d23b
@ -22,6 +22,7 @@ package org.bigbluebutton.modules.users.views {
|
||||
import flash.geom.Point;
|
||||
import mx.collections.ArrayCollection;
|
||||
import mx.containers.VBox;
|
||||
import mx.controls.Button;
|
||||
import mx.controls.Menu;
|
||||
import mx.core.ScrollPolicy;
|
||||
import mx.events.FlexMouseEvent;
|
||||
@ -30,6 +31,7 @@ package org.bigbluebutton.modules.users.views {
|
||||
import org.bigbluebutton.common.Images;
|
||||
import org.bigbluebutton.core.managers.UserManager;
|
||||
import org.bigbluebutton.main.model.users.events.EmojiStatusEvent;
|
||||
import org.bigbluebutton.main.views.WellPositionedMenu;
|
||||
import org.bigbluebutton.util.i18n.ResourceUtil;
|
||||
|
||||
public class MoodMenu extends VBox {
|
||||
@ -42,19 +44,25 @@ package org.bigbluebutton.modules.users.views {
|
||||
|
||||
private var menu:Menu;
|
||||
|
||||
private var _btn:Button;
|
||||
|
||||
public function set btn(btn:Button):void {
|
||||
_btn = btn;
|
||||
drawMoodMenu();
|
||||
}
|
||||
|
||||
public function MoodMenu() {
|
||||
dispatcher = new Dispatcher();
|
||||
images = new Images();
|
||||
addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE, mouseDownOutsideHandler, false, 0, true);
|
||||
this.horizontalScrollPolicy = ScrollPolicy.OFF;
|
||||
this.verticalScrollPolicy = ScrollPolicy.OFF;
|
||||
drawMoodMenu();
|
||||
}
|
||||
|
||||
public function show(position:Point):void {
|
||||
menu.x = position.x;
|
||||
menu.y = position.y;
|
||||
menu.show();
|
||||
public function show():void {
|
||||
if (menu != null) {
|
||||
menu.show();
|
||||
}
|
||||
}
|
||||
|
||||
private function drawMoodMenu():void {
|
||||
@ -71,7 +79,7 @@ package org.bigbluebutton.modules.users.views {
|
||||
|
||||
moods.addItem(item);
|
||||
}
|
||||
menu = Menu.createMenu(null, moods.toArray(), true);
|
||||
menu = WellPositionedMenu.createMenu(null, moods.toArray(), _btn, true);
|
||||
menu.addEventListener(MenuEvent.ITEM_CLICK, buttonMouseEventHandler, false, 0, true);
|
||||
}
|
||||
|
||||
|
@ -69,6 +69,7 @@
|
||||
import org.bigbluebutton.main.model.users.events.KickUserEvent;
|
||||
import org.bigbluebutton.main.model.users.events.RoleChangeEvent;
|
||||
import org.bigbluebutton.main.views.MainCanvas;
|
||||
import org.bigbluebutton.main.views.WellPositionedMenu;
|
||||
import org.bigbluebutton.modules.users.events.MeetingMutedEvent;
|
||||
import org.bigbluebutton.modules.users.events.UsersRollEvent;
|
||||
import org.bigbluebutton.modules.users.model.UsersOptions;
|
||||
@ -241,8 +242,8 @@
|
||||
private function openEmojiStatusMenu() : void
|
||||
{
|
||||
var moodMenu:MoodMenu = PopUpManager.createPopUp(DisplayObject(FlexGlobals.topLevelApplication), MoodMenu, false) as MoodMenu;
|
||||
var menuXY:Point = emojiStatusBtn.localToGlobal(new Point(emojiStatusBtn.width + 2, emojiStatusBtn.height - moodMenu.height));
|
||||
moodMenu.show(menuXY);
|
||||
moodMenu.btn = emojiStatusBtn;
|
||||
moodMenu.show();
|
||||
}
|
||||
|
||||
private function openSettings():void {
|
||||
@ -264,14 +265,11 @@
|
||||
// but it would require an extra listener for the MenuCloseEvent.
|
||||
if (paramsMenu) {
|
||||
paramsMenu.removeEventListener(MenuEvent.ITEM_CLICK, menuClickHandler);
|
||||
paramsMenu.removeEventListener(MenuEvent.MENU_SHOW, menuShowHandler);
|
||||
paramsMenu.hide();
|
||||
}
|
||||
|
||||
paramsMenu = Menu.createMenu(null, paramsMenuData, true);
|
||||
paramsMenu.variableRowHeight = false;
|
||||
paramsMenu = WellPositionedMenu.createMenu(null, paramsMenuData, settingsBtn, true);
|
||||
paramsMenu.addEventListener(MenuEvent.ITEM_CLICK, menuClickHandler);
|
||||
paramsMenu.addEventListener(MenuEvent.MENU_SHOW, menuShowHandler);
|
||||
paramsMenu.show();
|
||||
}
|
||||
|
||||
@ -281,13 +279,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
private function menuShowHandler(e:MenuEvent):void {
|
||||
paramsMenu.setFocus();
|
||||
var menuXY:Point = settingsBtn.localToGlobal(new Point(settingsBtn.width + 2, settingsBtn.height - paramsMenu.height));
|
||||
paramsMenu.x = menuXY.x;
|
||||
paramsMenu.y = menuXY.y;
|
||||
}
|
||||
|
||||
private function handleChangedLockSettingsEvent(e:LockControlEvent):void {
|
||||
var lockSettings:LockSettingsVO = UserManager.getInstance().getConference().getLockSettings();
|
||||
roomLocked = lockSettings.isAnythingLocked() && ( lockSettings.getLockOnJoin() || UsersUtil.isAnyoneLocked());
|
||||
|
Loading…
Reference in New Issue
Block a user