Call annotation as a function instead of a property

This is because, like tooltip(), it doesn't always make sense to call it,
and it should never get called if the operation is not available.
This commit is contained in:
Bryan Housel
2017-02-15 23:02:13 -05:00
parent b7a81c6bec
commit 2ce78d6c43
13 changed files with 79 additions and 31 deletions
+2 -2
View File
@@ -15,9 +15,9 @@ export function behaviorOperation(context) {
d3.event.preventDefault();
var disabled = which.disabled();
if (disabled) {
uiFlash(2000, 500).text(which.tooltip);
uiFlash(2500, 500).text(which.tooltip);
} else {
var annotation = which.annotation || which.title;
var annotation = which.annotation() || which.title;
uiFlash(1500, 250).text(annotation);
which();
}