Hi,
The title says it all.
if you instanciate a view extending Resthub.View that has a "root" value defined in it, or if root is specified in the options object, this view's el will be attached to the root element during the instanciation, even if "render" is never called. I don't think this should be the case.
example :
function (Resthub) {
var Popin = Resthub.View.extend({
className: 'test',
});
return Popin;
});
new Popin(); --> $el is attached
new Popin({root:"body"}); --> $el is atttached to the body during this call.
apparently, the el gets attached to the root element in the Resthub method "_insertRoot".
The call stack is as follows :
(backbone.js) View ( http://backbonejs.org/docs/backbone.html#section-120 )
(backbone.js) _ensureElement ( http://backbonejs.org/docs/backbone.html#section-133)
(resthub.js) setElement
(resthub.js) _insertRoot
Maybe this behavior should be moved to the render ?
Thanks,
Léo.
Hi,
The title says it all.
if you instanciate a view extending Resthub.View that has a "root" value defined in it, or if root is specified in the options object, this view's el will be attached to the root element during the instanciation, even if "render" is never called. I don't think this should be the case.
example :
function (Resthub) {
var Popin = Resthub.View.extend({
className: 'test',
});
return Popin;
});
new Popin(); --> $el is attached
new Popin({root:"body"}); --> $el is atttached to the body during this call.
apparently, the el gets attached to the root element in the Resthub method "_insertRoot".
The call stack is as follows :
(backbone.js) View ( http://backbonejs.org/docs/backbone.html#section-120 )
(backbone.js) _ensureElement ( http://backbonejs.org/docs/backbone.html#section-133)
(resthub.js) setElement
(resthub.js) _insertRoot
Maybe this behavior should be moved to the render ?
Thanks,
Léo.