<commit_before>// ========================================================================
// SproutCore
// copyright 2006-2008 Sprout Systems, Inc.
// ========================================================================

require('panes/overlay') ;

SC.PICKER_PANE = 'picker';
SC.PickerPaneView = SC.OverlayPaneView.extend({
  
  emptyElement: '<div class="pane picker-pane"><div class="shadow pane-wrapper picker-pane-wrapper"><div class="pane-root"></div><div class="top-left-edge"></div><div class="top-edge"></div><div class="top-right-edge"></div><div class="right-edge"></div><div class="bottom-right-edge"></div><div class="bottom-edge"></div><div class="bottom-left-edge"></div><div class="left-edge"></div></div></div>',
  
  layer: 300,
  
  isModal: false,

  // The ideal position for a picker pane is just below the anchor that 
  // triggered it.  Find that ideal position, then call adjustPosition.
  positionPane: function() {
    var anchor = this.anchorView ;
    var picker = this.containerView ;
    var origin ;
    
    // usually an anchorView will be passed.  The ideal position to appear is
    // just below the anchorView.  If that is not possible, fitToScreen will
    // take care of that.
    if (anchor) {
      origin = picker.convertFrameFromView(anchor.get('frame'), anchor) ;
      origin.y += origin.height ;
      origin = this.fitPositionToScreen(origin, picker, anchor) ;
      
    // if no anchor view has been set for some reason, just center.
    } else {
      var wsize = SC.window.get('size') ;
      var psize = picker.get('size') ;
      origin.x = (wsize.width - psize.width) / 2 ;
      origin.y = (wsize.height - psize.height) / 2 ;
    }
    
    picker.set('origin',origin) ;
  }
  
  
}) ;

<commit_msg>Fix [82]: picker.js bug (thanks <NAME>)<commit_after>// ========================================================================
// SproutCore
// copyright 2006-2008 Sprout Systems, Inc.
// ========================================================================

require('panes/overlay') ;

SC.PICKER_PANE = 'picker';
SC.PickerPaneView = SC.OverlayPaneView.extend({
  
  emptyElement: '<div class="pane picker-pane"><div class="shadow pane-wrapper picker-pane-wrapper"><div class="pane-root"></div><div class="top-left-edge"></div><div class="top-edge"></div><div class="top-right-edge"></div><div class="right-edge"></div><div class="bottom-right-edge"></div><div class="bottom-edge"></div><div class="bottom-left-edge"></div><div class="left-edge"></div></div></div>',
  
  layer: 300,
  
  isModal: false,

  // The ideal position for a picker pane is just below the anchor that 
  // triggered it.  Find that ideal position, then call adjustPosition.
  positionPane: function() {
    var anchor = this.anchorView ;
    var picker = this.containerView ;
    var origin ;
    
    // usually an anchorView will be passed.  The ideal position to appear is
    // just below the anchorView.  If that is not possible, fitToScreen will
    // take care of that.
    if (anchor) {
      origin = picker.convertFrameFromView(anchor.get('frame'), anchor) ;
      origin.y += origin.height ;
      origin = this.fitPositionToScreen(origin, picker, anchor) ;
      
    // if no anchor view has been set for some reason, just center.
    } else {
      var wsize = SC.window.get('size') ;
      var psize = picker.get('size') ;
      origin = {};
      origin.x = (wsize.width - psize.width) / 2 ;
      origin.y = (wsize.height - psize.height) / 2 ;
    }
    
    picker.set('origin',origin) ;
  }
  
  
}) ;


{'fraction_non_alphanumeric': 0.223717409587889, 'fraction_numerical': 0.00784973366975049, 'mean_word_length': 3.394088669950739, 'pattern_counts': {'":': 0, '<': 48, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1626002', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1041, 'n_words': 266}