1 // ==========================================================================
  2 // Papercube.ZoomButtonView
  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   ZoomButton is used as part of the zoomView. 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.ZoomButtonView = SC.View.extend(
 21 /** @scope Papercube.ZoomButtonView.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 it is a zoom out or zoom in button.
 33     
 34     @property {Boolean}
 35     @config
 36     @default YES
 37     @default YES
 38   */
 39   zoomOut: YES,
 40   
 41   /** 
 42     Mouse down action that either zooms in or out.
 43   */
 44   mouseDown: function()
 45   {
 46     if(this.get("zoomOut"))
 47       Papercube.canvasController.zoomOut();
 48     else
 49       Papercube.canvasController.zoomIn();
 50   }
 51   
 52 }) ;
 53