Page.setup(function(state) {
// FIXME and all similar tests. Use state.scope.$element (should be root)
if (document.body.getAttribute('block-type') != "page") {
return;
}
should be
Page.setup(function(state) {
if (state.scope.$page.type != "page") {...}
if (state.scope.$root.element.group != "page") {...}
Typically:
should be
anything except having to look up in the dom.