Respond to updates from presence context menu
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
c483717282
commit
7307bc412f
1 changed files with 5 additions and 4 deletions
|
@ -82,8 +82,10 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onStatusChange: function(newStatus) {
|
onStatusChange: function(newStatus) {
|
||||||
console.log(this.state);
|
Presence.stopMaintainingStatus();
|
||||||
console.log(newStatus);
|
if (newStatus === "online") {
|
||||||
|
Presence.setState(newStatus);
|
||||||
|
} else Presence.setState(newStatus, null, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
onClick: function(e) {
|
onClick: function(e) {
|
||||||
|
@ -96,13 +98,12 @@ module.exports = React.createClass({
|
||||||
let y = elementRect.top + (elementRect.height / 2) + window.pageYOffset;
|
let y = elementRect.top + (elementRect.height / 2) + window.pageYOffset;
|
||||||
y = y - (chevronOffset + 4); // where 4 is 1/4 the height of the chevron
|
y = y - (chevronOffset + 4); // where 4 is 1/4 the height of the chevron
|
||||||
|
|
||||||
const self = this;
|
|
||||||
ContextualMenu.createMenu(PresenceContextMenu, {
|
ContextualMenu.createMenu(PresenceContextMenu, {
|
||||||
chevronOffset: chevronOffset,
|
chevronOffset: chevronOffset,
|
||||||
chevronFace: 'bottom',
|
chevronFace: 'bottom',
|
||||||
left: x,
|
left: x,
|
||||||
top: y,
|
top: y,
|
||||||
menuWidth: 300,
|
menuWidth: 125,
|
||||||
currentStatus: this.state.status,
|
currentStatus: this.state.status,
|
||||||
onChange: this.onStatusChange,
|
onChange: this.onStatusChange,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue