Skip to content

Instantly share code, notes, and snippets.

@jeiting
Created March 29, 2010 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeiting/348155 to your computer and use it in GitHub Desktop.
Save jeiting/348155 to your computer and use it in GitHub Desktop.
// ==========================================================================
// Project: ExposureViewer.mainController
// Copyright: ©2010 My Company, Inc.
// ==========================================================================
/*globals ExposureViewer StandardViews*/
/** @class
(Document Your Controller Here)
@extends SC.Object
*/
ExposureViewer.exposureController = SC.Object.create(
/** @scope ExposureViewer.mainController.prototype */
{
init: function() {
SC.Timer.schedule({
target: this,
action: 'updateExposure',
interval: 10
});
},
currentExposure: function() {
console.log('Log!');
var result = ExposureViewer.store.find(StandardViews.Exposure, "146");
console.log(result);
return result;
}.property(),
updateExposure: function() {
console.log('Updating exposure.');
var exposure = this.get('currentExposure');
console.log('' + exposure);
console.log(exposure.get('exposed'));
if (!exposure.get('exposed')) {
exposure.set('exposed', true);
console.log('exposed is false!');
} else {
console.log('exposed is true!');
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment