Sha256: 0fe527ee4f0f51025ad9ec1b98fe6d7f7782b78f5f3d52956f3e5f2b563f5e9c

Contents?: true

Size: 1.47 KB

Versions: 11

Compression:

Stored size: 1.47 KB

Contents

// ==========================================================================
// Project:   Greenhouse.TearOffPicker
// Copyright: ©2010 Mike Ball
// ==========================================================================
/*globals Greenhouse */
/**

  @extends SC.PickerPane
*/
Greenhouse.TearOffPicker = SC.PickerPane.extend(
/** @scope Greenhouse.TearOffPicker.prototype */ {

  dragAction: '',

  mouseDragged: function(evt){

    Greenhouse.sendAction(this.get('dragAction'));
    this._blockedIframe = YES;
    Greenhouse.eventBlocker.set('isVisible', YES);

    return sc_super();
  },

  mouseUp: function(evt){
    if(this._blockedIframe){
      Greenhouse.eventBlocker.set('isVisible', NO);
      this._blockedIframe = NO;
    }
    return YES;
  },

  mouseDown: function(evt) {
    var f=this.get('frame');
    this._mouseOffsetX = f ? (f.x - evt.pageX) : 0;
    this._mouseOffsetY = f ? (f.y - evt.pageY) : 0;
    return this.modalPaneDidClick(evt);
  },

  modalPaneDidClick: function(evt) {
    var f = this.get("frame");
    if(!this.clickInside(f, evt)){
      Greenhouse.sendAction('cancel');
    }
    return YES ;
  },

  computeAnchorRect: function(anchor) {
    var ret = SC.offset(anchor); // get x & y
    var cq = SC.$(anchor);
    var wsize = SC.RootResponder.responder.computeWindowSize() ;
    ret.width = cq.outerWidth();
    ret.height = (wsize.height-ret.y) < cq.outerHeight() ? (wsize.height-ret.y) : cq.outerHeight();
    ret.y = ret.y -11;
    return ret ;
  }
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sproutcore-1.11.0 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js
sproutcore-1.11.0.rc3 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js
sproutcore-1.11.0.rc2 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js
sproutcore-1.11.0.rc1 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js
sproutcore-1.10.3.1 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js
sproutcore-1.10.2 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js
sproutcore-1.10.1 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js
sproutcore-1.10.0 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js
sproutcore-1.10.0.rc.3 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js
sproutcore-1.10.0.rc.2 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js
sproutcore-1.10.0.rc.1 lib/frameworks/sproutcore/apps/greenhouse/views/tear_off_picker.js