Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.98 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. allowsEmptySelection: NO,
  2.   allowsMultipleSelection: NO,
  3.  
  4.   current: null,
  5.  
  6.   previous: function () {
  7.     var current = this.get('current');
  8.     return this.objectAt(this.lastIndexOf(current)-1) || null;
  9.   }.property('current').cacheable(),
  10.  
  11.   next: function () {
  12.     var current = this.get('current');
  13.     return this.objectAt(this.lastIndexOf(current)+1) || null;
  14.   }.property('current').cacheable(),
  15.  
  16.   backImage: function () {
  17.     if (this.get('canNavigateBackward')) {
  18.       this.set('current', this.get('previous'));
  19.     }
  20.     return YES;
  21.   },
  22.  
  23.   forwardImage: function () {
  24.     if (this.get('canNavigateForward')) {
  25.       this.set('current', this.get('next'));
  26.     }
  27.     return YES;
  28.   },
  29.  
  30.   canNavigateBackward: function () {
  31.     return this.get('current') !== this.objectAt(0);
  32.   }.property('current').cacheable(),
  33.  
  34.   canNavigateForward: function () {
  35.     return this.get('current') !== this.objectAt(this.get('length')-1);
  36.   }.property('current').cacheable()