Continued porting to react

This commit is contained in:
Colin McLeod
2016-02-02 09:13:59 -08:00
parent b42a812a45
commit d783a38588
43 changed files with 679 additions and 411 deletions

View File

@@ -14,6 +14,17 @@ export function wrapCtxMenu(cb) {
};
}
/**
* Stop context menu / right-click propagation unless shift is held.
* @param {SyntheticEvent} event Event
*/
export function stopCtxPropagation(event) {
if (!event.getModifierState('Shift')) {
event.preventDefault();
event.stopPropagation();
}
}
/**
* Compares A and B and return true using strict comparison (===)
* @param {any} objA A