Skip to content

Instantly share code, notes, and snippets.

@MikailCliftov
Created May 13, 2011 18:20
Show Gist options
  • Save MikailCliftov/971023 to your computer and use it in GitHub Desktop.
Save MikailCliftov/971023 to your computer and use it in GitHub Desktop.
Rapid.isBusyController = SC.ArrayController.create({
isBusy: NO,
manageBusyState: function(item){
this.set('isBusy', YES);
if (item && (status = item.get('status'))){
while ((status = item.get('status')) & SC.Record.BUSY){
SC.RunLoop.begin(); //<---no affect
SC.RunLoop.end(); //<--- i guess the jobs in here affect teh status
}
}
this.set('isBusy', NO);
}
});
------------------------------------------------------------------------------------
progressView: Rapid.ProgressView.design({
layout: {centerX:0, centerY:0, height:150, width:150, border:0},
isBusyBinding: SC.Binding.from('Rapid.isBusyController.isBusy'),
isVisible: function(){
var isBusy = this.get('isBusy');
if(isBusy) console.log('i should be shown');
this.updateLayerIfNeeded();
return this.get('isBusy');
}.property('isBusy')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment