<commit_before>class AppSettingsMenuButton extends KDButtonView

  constructor: (options = {}, data) ->

    options.cssClass = "app-settings-menu"
    options.iconOnly = yes
    options.callback = (event) =>
      menu = @getData()
      return unless menu

      {mainTabView} = KD.getSingleton "mainView"
      menu.forEach (item, index) =>

        item.callback = (contextmenu) =>
          view = mainTabView.activePane?.mainView
          item.eventName or= item.title
          view?.emit "menu.#{item.eventName}", item.eventName, item, contextmenu
          @contextMenu.destroy()

      @createMenu event, menu

    super options, data

  createMenu: (event, menu) ->
    offset = @$().offset()
    @contextMenu = new JContextMenu
      event       : event
      delegate    : @
      x           : offset.left - 150
      y           : offset.top + 20
      arrow       :
        placement : "top"
        margin    : -5
    , menu<commit_msg>app-settings-menu: Passed menu offset to child item callback method.<commit_after>class AppSettingsMenuButton extends KDButtonView

  constructor: (options = {}, data) ->

    options.cssClass = "app-settings-menu"
    options.iconOnly = yes
    options.callback = (event) =>
      menu = @getData()
      return unless menu

      {mainTabView} = KD.getSingleton "mainView"
      menu.forEach (item, index) =>

        item.callback = (contextmenu) =>
          view = mainTabView.activePane?.mainView
          item.eventName or= item.title
          @contextMenu.destroy()
          view?.emit "menu.#{item.eventName}", item.eventName, item, contextmenu, @offset

      @createMenu event, menu

    super options, data

  createMenu: (event, menu) ->
    @offset = @$().offset()
    @contextMenu = new JContextMenu
      delegate    : @
      x           : @offset.left - 150
      y           : @offset.top + 20
      arrow       :
        placement : "top"
        margin    : -5
    , menu
{'fraction_non_alphanumeric': 0.11390456644433043, 'fraction_numerical': 0.0061570035915854285, 'mean_word_length': 2.0854430379746836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1222666', 'n_tokens_mistral': 573, 'n_tokens_neox': 548, 'n_words': 138}