<commit_before>class KDButtonMenu extends KDContextMenu
  constructor:(options,data)->
    options = options ? {}
    # options.parent = "body"
    super options,data
    @setClass "kdbuttonmenu"
    @setPartial "<div class='chevron-arrow-ghost-wrapper'><span class='chevron-arrow-ghost'></span></div>"

  positionContextMenu:()->
    button        = @getDelegate()
    mainHeight    = $(window).height()
    buttonHeight  = button.$().outerHeight()
    buttonWidth   = button.$().outerWidth()
    top           = button.getY() + buttonHeight
    menuHeight    = @$().outerHeight()
    menuWidth     = @$().outerWidth()

    log buttonHeight, buttonWidth, button

    if top + menuHeight > mainHeight
      top = button.getY() - menuHeight
      @setClass "top-menu"
      ghostCss = 
        top     : "100%"
        height  : buttonHeight
    else
      ghostCss = 
        top     : -(buttonHeight + 1)
        height  : buttonHeight

    @$(".chevron-arrow-ghost-wrapper").css ghostCss
    
    @$().css
      top       : top
      left      : button.getX() + buttonWidth - menuWidth

class JButtonMenu extends JContextMenu

  constructor:->

    super
    @setClass "kdbuttonmenu"
    @setPartial "<div class='chevron-arrow-ghost-wrapper'><span class='chevron-arrow-ghost'></span></div>"

  positionContextMenu:()-><commit_msg>removed log<commit_after>class KDButtonMenu extends KDContextMenu
  constructor:(options,data)->
    options = options ? {}
    # options.parent = "body"
    super options,data
    @setClass "kdbuttonmenu"
    @setPartial "<div class='chevron-arrow-ghost-wrapper'><span class='chevron-arrow-ghost'></span></div>"

  positionContextMenu:()->
    button        = @getDelegate()
    mainHeight    = $(window).height()
    buttonHeight  = button.$().outerHeight()
    buttonWidth   = button.$().outerWidth()
    top           = button.getY() + buttonHeight
    menuHeight    = @$().outerHeight()
    menuWidth     = @$().outerWidth()

    # log buttonHeight, buttonWidth, button

    if top + menuHeight > mainHeight
      top = button.getY() - menuHeight
      @setClass "top-menu"
      ghostCss = 
        top     : "100%"
        height  : buttonHeight
    else
      ghostCss = 
        top     : -(buttonHeight + 1)
        height  : buttonHeight

    @$(".chevron-arrow-ghost-wrapper").css ghostCss
    
    @$().css
      top       : top
      left      : button.getX() + buttonWidth - menuWidth

class JButtonMenu extends JContextMenu

  constructor:->

    super
    @setClass "kdbuttonmenu"
    @setPartial "<div class='chevron-arrow-ghost-wrapper'><span class='chevron-arrow-ghost'></span></div>"

  positionContextMenu:()->
{'fraction_non_alphanumeric': 0.13776276276276275, 'fraction_numerical': 0.003003003003003003, 'mean_word_length': 2.6062246278755072, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 29, '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': '5321590', 'n_tokens_mistral': 833, 'n_tokens_neox': 793, 'n_words': 160}