1 // ==========================================================================
  2 // Papercube.DepthButtonView
  3 //
  4 // License:  PaperCube is open source software released under 
  5 //           the MIT License (see license.js)
  6 // ==========================================================================
  7 
  8 require('core');
  9 
 10 /** @class
 11 
 12   DepthButton is used as part of the collaborator View. Allows 
 13   quick access to the max and min values.
 14 
 15   @extends SC.View
 16   @author Peter Bergstrom
 17   @version 1.0
 18   @copyright 2008-2009 Peter Bergström.
 19 */
 20 Papercube.DepthButtonView = SC.View.extend(
 21 /** @scope Papercube.DepthButtonView.prototype */ {
 22   
 23   /**
 24     Empty element is an empty DIV.
 25 
 26     @property {String}
 27     @default "<div></div>"
 28   */
 29   emptyElement: "<div></div>",
 30   
 31   /** 
 32     Boolean value specifying if the action is adding depth or not.
 33     
 34     @property {Boolean}
 35     @config
 36     @default YES
 37   */
 38   maxDepth: YES,
 39   
 40   /** 
 41     The controller that needs to be called.
 42   
 43     @property {ObjectController}
 44     @config
 45   */
 46   controller: null,
 47   
 48   /** 
 49     Mouse down action that either increases or decreases the depth.
 50   */
 51   mouseDown: function()
 52   {
 53     var controller = this.get('controller');
 54     if(controller)
 55     {
 56       if(this.get("maxDepth"))
 57         controller.maxDepth();
 58       else
 59         controller.minDepth();
 60     }
 61   }
 62   
 63 }) ;
 64