fml toggle update

This commit is contained in:
Steffen Schröder 2014-01-05 17:30:19 +01:00
parent 3c784505d2
commit cd475c6508
3 changed files with 10 additions and 5 deletions

View File

@ -205,7 +205,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$backgroundQuad->setSize(count($this->adminMenuItems) * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY);
$script->addTooltip($itemQuad, $popoutFrame, Script::OPTION_TOOLTIP_ONCLICK);
$script->addToggle($itemQuad, $popoutFrame);
// Add items
$x = -1;
@ -273,7 +273,7 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
$backgroundQuad->setStyles($quadStyle, $quadSubstyle);
$backgroundQuad->setSize(count($this->playerMenuItems) * $itemSize * 1.15 + 2, $itemSize * $itemMarginFactorY);
$script->addTooltip($itemQuad, $popoutFrame, Script::OPTION_TOOLTIP_ONCLICK);
$script->addToggle($itemQuad, $popoutFrame);
// Add items
$x = -1;

View File

@ -297,6 +297,12 @@ class Script {
return $this;
}
$toggleControl->checkId();
if ($mode == self::CLASS_HIDE) {
$toggleControl->setVisible(true);
}
else {
$toggleControl->setVisible(false);
}
$clickControl->setScriptEvents(true);
$clickControl->addClass(self::CLASS_TOGGLE);
$clickControl->addClass($mode);

View File

@ -191,8 +191,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
$itemSize = $width;
$maniaLink = new ManiaLink(self::MLID_DONATE_WIDGET);
$script = new Script();
$maniaLink->setScript($script);
$script = $maniaLink->getScript();
// Donate Menu Icon Frame
$frame = new Frame();
@ -230,7 +229,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
$popoutFrame->add($quad);
$script->addTooltip($itemQuad, $popoutFrame, Script::OPTION_TOOLTIP_ONCLICK);
$script->addToggle($itemQuad, $popoutFrame);
// Description Label
$descriptionFrame = new Frame();