Skip to content

Instantly share code, notes, and snippets.

@autarch
Created July 13, 2011 03:26
Show Gist options
  • Save autarch/1079651 to your computer and use it in GitHub Desktop.
Save autarch/1079651 to your computer and use it in GitHub Desktop.
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() );
}
}
}
);
@autarch
Copy link
Author

autarch commented Jul 13, 2011

Causes this error:

lazy.replace is not a function
return function(){if(!me.hasValue(this...lazy:this[lazy.replace(/^this./,'')]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment