Created
May 13, 2011 18:20
-
-
Save MikailCliftov/971023 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
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