Skip to content

Instantly share code, notes, and snippets.

@jkishner
Created August 6, 2013 15:04
Show Gist options
  • Save jkishner/6165299 to your computer and use it in GitHub Desktop.
Save jkishner/6165299 to your computer and use it in GitHub Desktop.
for Fargo.io: adds a checkbox to a headline that has no icon; if the icon is "check-empty" it changes it to "check"; if the icon is "check" it makes the headline a child of the last headline in the outline and then collapses that parent headline
todo
var value = op.attributes.getOne ("icon");
if (!value) {
op.attributes.setOne ("icon", "check-empty");
}
else if (value == "check-empty") {
op.attributes.deleteOne ("icon");
op.attributes.setOne ("icon", "check");
}
else if (value == "check") {
op.reorg (down, infinity);
op.reorg (right, 1);
op.go (left, 1);
op.collapse ();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment