{{!-- Becomes hamburger menu button in mobile view. Placed after the topbar so it stacks above
the other topbar items without needing z-index, which would make it impossible to have
modals cover this button. --}}
{{!-- We wish to block reload if there are *any* grains open, regardless of the current route --}}
{{#if grainCount }}
{{>sandstormTopbarBlockReload ""}}
{{/if}}
{{#with currentPopup}}
{{#if onlyPopup}}
{{>popupTemplate data.get}}
{{else}}
{{#with position}}
{{>popupTemplateNested ../data.get}}
{{/with}}
{{/if}}
{{/with}}
{{/let}}
{{!--
Convenience helper for registering topbar items.
You can insert something like this into a template to indicate that while the template is
displayed, an item should be added to the top bar:
{{>sandstormTopbarItem name="foo" topbar=myTopbar data="whatever" template="fooTemplate"}}
The topbar item will use the given template. The template will receive `data` as its data
context.
The effect is that as long as the parent template is instantiated, the inner part will be
registered as a topbar item. When the parent template is disposed, the template item will
be unregistered. MAGIC!
The parameter `topbar` refers to the SandstormTopbar object with which to register the item.
As a special hack, you can also use this template like so:
{{#sandstormTopbarItem name="foo" topbar=myTopbar}}
inline template!!!
{{/sandstormTopbarItem}}
This syntax essentially defines `template` inline. Note, however, that because these template
will not be inserted directly into the parent template, there are some limitations:
* Event handlers on the parent template will NOT catch events on the topbar items.
* If you don't specify `data`, the current context will be inherited. However, its parents
will NOT be inherited, so you can't use Template.parentData() to get them.
* Helper functions on the parent template CAN be used in the topbar items, though.
As an extra-special hack, you can also do:
{{#sandstormTopbarItem name="foo" topbar=myTopbar}}
inline template!!!
{{else}}
inline popup template!!!
{{/sandstormTopbarItem}}
This further specifies a template for the popup window that should appear when the item is
clicked. The use of {{else}} for this is a huge hack; it's really not an "else" at all.
--}}
{{!--
Convenience template that blocks reload while it exists. Embed this in any UI which would
be bad to unexpectedly reload on hot code update.
--}}