SlexAxton/yepnope.js — pull request #77 by SimpleAsCouldBe (2011-11-11 17:49:23+00:00)
Title: Support for specifying scope in callbacks. First attempt.

I really needed a way to control the scope in the yepnope callbacks.
This is a lousy way of doing that, but it works for my needs.
I tried to do it correctly, but your execstack was beyond my abilities to figure out.

Goal for me is to be able to use yepnope like this:

myNamespace.emc = function()
{
this.buildInitialView();
}//Constructor

myNamespace.emc.prototype = {
tabBar: null

, buildInitialView: function()
{
yepnope({
test: true
, yep: 'components/iSirona.slidingTabBar.js'
, callback: function(a, b, c, d) {
this.tabBar = new myNamespace.slidingTabBar();
this.hello();
}
, callbackScope: this
});//yepnope
}
, hello: function()
{
console.log('Hello from myNamespace.emc');
}
}