1 // ==========================================================================
  2 // Papercube.LinkStrengthButtonView
  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   LinkStrengthButtonView 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.LinkStrengthButtonView = SC.View.extend(
 21 /** @scope Papercube.LinkStrengthButtonView.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 go to max strength requirements or not.
 33     
 34     @property {Boolean}
 35     @config
 36     @default YES
 37     @default YES
 38   */
 39   maxStrength: YES,
 40     
 41   /** 
 42     The controller that needs to be called.
 43   
 44     @property {ObjectController}
 45     @config
 46   */
 47   controller: null,
 48   
 49   /** 
 50     Option param allows you to pass in multi action information. 
 51     
 52     Default NO but can be set to any action.
 53     
 54     @property {Boolean}
 55     @config
 56     @default YES
 57     @default NO
 58   */
 59   option: NO,
 60   
 61   /** 
 62     Mouse down action that either increases or decreases the depth.
 63   */
 64   mouseDown: function()
 65   {
 66     var controller = this.get('controller');
 67     if(controller)
 68     {
 69       if(this.get("maxStrength"))
 70         controller.maxStrength(this.get('option'));
 71       else
 72         controller.minStrength(this.get('option'));
 73     }
 74   }
 75   
 76 }) ;
 77