Created
July 13, 2011 03:26
-
-
Save autarch/1079651 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Role( | |
'R2.Role.Spinner', { | |
my: { | |
has: { | |
Spinner: { | |
is: 'roc', | |
isPrivate: true, | |
lazy: true, | |
builder: '_BuildSpinner' | |
} | |
}, | |
methods: { | |
_BuildSpinner: function () { | |
var spinner = $("<img/>"); | |
spinner.attr( "alt", "spinner image" ); | |
spinner.attr( "title", "Loading ..." ); | |
spinner.attr( "src", "/images/spinner.gif" ); | |
return spinner; | |
} | |
} | |
}, | |
methods: { | |
_showSpinner: function (selector) { | |
var elt = $(selector); | |
if ( ! elt.length ) { | |
return; | |
} | |
elt.children().detach(); | |
elt.append( this.my.Spinner() ); | |
} | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Causes this error:
lazy.replace is not a function
return function(){if(!me.hasValue(this...lazy:this[lazy.replace(/^this./,'')]