pageboard / client

Web site building system - client packages
MIT License
4 stars 0 forks source link

stop using body block-type to determine root type #117

Open kapouer opened 4 years ago

kapouer commented 4 years ago

Typically:

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") {...}

anything except having to look up in the dom.