You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it( 'calls duplicate onmatch on same specificity with super', function() {
var a = 0, b=0;
$('.foo').entwine({onmatch: function(){a += 1;}})
$('.foo').entwine({onmatch: function(){b += 1; this._super();}})
expect([a, b]).toEqual( [0, 0]);
$('#a').addClass('foo');
expect([a, b]).toEqual( [1, 1]);
});
Its unclear to me whether this should work. super() seems to be tested for less specific selectors only.
If thats its only intended use case, do we only allow customization of an existing codebase by being more specific?
I have this problem in the CMS at the moment, for isolating features into their own files.
Its misusing entwine a bit by applying stuff to a "base element", but not everything applies directly to a DOM element.
// DOM structure
<body class="LeftAndMain CMSMain">...</body>
// LeftAndMain.js
$('.LeftAndMain').entwine(
onmatch: function() {
// setup layout etc. - never called because of LeftAndMain.Ping.js
}
});
// LeftAndMain.Ping.js
$('.LeftAndMain').entwine(
onmatch: function() {
// setup ping
}
});
// CMSMain.js
$('.CMSMain').entwine(
onmatch: function() {
// setup cms specific stuff
this._super();
}
});
The text was updated successfully, but these errors were encountered:
Failing test for spec.entwine.ctors.js:
Its unclear to me whether this should work. super() seems to be tested for less specific selectors only.
If thats its only intended use case, do we only allow customization of an existing codebase by being more specific?
I have this problem in the CMS at the moment, for isolating features into their own files.
Its misusing entwine a bit by applying stuff to a "base element", but not everything applies directly to a DOM element.
The text was updated successfully, but these errors were encountered: