<commit_before>dc.ui.Menu = Backbone.View.extend({

  className : 'minibutton menu',

  options : {id : null, standalone : false},

  events : {
    'click'        : 'open',
    'selectstart'  : '_stopSelect'
  },

  constructor : function(options) {
    this.modes = {};
    _.bindAll(this, 'close');
    Backbone.View.call(this, options);
    this.items          = [];
    //this.content        = $(JST['common/menu'](this.options));
    //this.itemsContainer = $('.menu_items', this.content);
    //this.addIcon        = $('.bullet_add', this.content);
    this.modes.open     = 'not';
    if (options.items) this.addItems(options.items);
  },

  render : function() {
    $(this.el).html(JST['common/menubutton']({label : this.options.label}));
    this._label = this.$('.label');
    $(document.body).append(this.content);
    return this;
  },

  open : function() {
    var content = this.content;
    if (this.modes.enabled == 'not') return false;
    if (this.modes.open == 'is' && !this.options.standalone) return this.close();
    this.setMode('is', 'open');
    if (this.options.onOpen) this.options.onOpen(this);
    content.show();
    content.align(this.el, '-left bottom no-constraint');
    content.autohide({onHide : this.close});<commit_msg>Restore the attachment of options to Menus, as automatic attachment was removed from Backbone<commit_after>dc.ui.Menu = Backbone.View.extend({

  className : 'minibutton menu',

  options : {id : null, standalone : false},

  events : {
    'click'        : 'open',
    'selectstart'  : '_stopSelect'
  },
  
  initialize: function(options) {
    this.options = options;
  },

  constructor : function(options) {
    this.modes = {};
    _.bindAll(this, 'close');
    Backbone.View.call(this, _.extend({}, this.options, options));
    this.items          = [];
    //this.content        = $(JST['common/menu'](this.options));
    //this.itemsContainer = $('.menu_items', this.content);
    //this.addIcon        = $('.bullet_add', this.content);
    this.modes.open     = 'not';
    if (options.items) this.addItems(options.items);
  },

  render : function() {
    $(this.el).html(JST['common/menubutton']({label : this.options.label}));
    this._label = this.$('.label');
    $(document.body).append(this.content);
    return this;
  },

  open : function() {
    var content = this.content;
    if (this.modes.enabled == 'not') return false;
    if (this.modes.open == 'is' && !this.options.standalone) return this.close();
    this.setMode('is', 'open');
    if (this.options.onOpen) this.options.onOpen(this);
    content.show();
    content.align(this.el, '-left bottom no-constraint');
    content.autohide({onHide : this.close});
{'fraction_non_alphanumeric': 0.18458117123795403, 'fraction_numerical': 0.0, 'mean_word_length': 3.0343796711509716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5547000', 'n_tokens_mistral': 886, 'n_tokens_neox': 861, 'n_words': 164}