<commit_before>/*!
 * VIZABI FIND CONTROL
 * Reusable find dialog
 */

(function () {

  "use strict";

  var Vizabi = this.Vizabi;
  var utils = Vizabi.utils;
  var Dialog = Vizabi.Component.get('gapminder-buttonlist-dialog');

  if (!Vizabi._require('d3')) return;

  Vizabi.Component.register('gapminder-buttonlist-find', Dialog.extend({

    init: function (config, parent) {
      this.name = 'find';
      var _this = this;

      this.components = [{
        component: 'gapminder-bubbleopacity',
        placeholder: '.vzb-dialog-bubbleopacity',
        model: ["state.entities"],
        arg: "opacitySelectDim"
      }];

      this.model_binds = {
        "change:state:entities:select": function (evt) {
          _this.ready();
        },
        "change:state:time:value": function (evt) {
          if(!_this.model.state.time.playing) {
            _this.ready();
          }
        }
      }

      this._super(config, parent);
    },

    /**
     * Grab the list div
     */
    readyOnce: function () {
      this.element = d3.select(this.element);
      this.list = this.element.select(".vzb-find-list");
      this.input_search = this.element.select("#vzb-find-search");
      this.deselect_all = this.element.select("#vzb-find-deselect");
      this.opacity_nonselected = this.element.select(".vzb-dialog-bubbleopacity");

      this.KEY = this.model.state.entities.getDimension();

      var _this = this;
      this.input_search.on("input", function () {
        _this.showHideSearch();
      });

      this.deselect_all.on("click", function () {
        _this.deselectEntities();
      });

      this._super();
    },

    open: function () {
      this._super();

      this.input_search.node().value = "";
      this.showHideSearch();<commit_msg>Add focus on text field after opening the dialog<commit_after>/*!
 * VIZABI FIND CONTROL
 * Reusable find dialog
 */

(function () {

  "use strict";

  var Vizabi = this.Vizabi;
  var utils = Vizabi.utils;
  var Dialog = Vizabi.Component.get('gapminder-buttonlist-dialog');

  if (!Vizabi._require('d3')) return;

  Vizabi.Component.register('gapminder-buttonlist-find', Dialog.extend({

    init: function (config, parent) {
      this.name = 'find';
      var _this = this;

      this.components = [{
        component: 'gapminder-bubbleopacity',
        placeholder: '.vzb-dialog-bubbleopacity',
        model: ["state.entities"],
        arg: "opacitySelectDim"
      }];

      this.model_binds = {
        "change:state:entities:select": function (evt) {
          _this.ready();
        },
        "change:state:time:value": function (evt) {
          if(!_this.model.state.time.playing) {
            _this.ready();
          }
        }
      }

      this._super(config, parent);
    },

    /**
     * Grab the list div
     */
    readyOnce: function () {
      this.element = d3.select(this.element);
      this.list = this.element.select(".vzb-find-list");
      this.input_search = this.element.select("#vzb-find-search");
      this.deselect_all = this.element.select("#vzb-find-deselect");
      this.opacity_nonselected = this.element.select(".vzb-dialog-bubbleopacity");

      this.KEY = this.model.state.entities.getDimension();

      var _this = this;
      this.input_search.on("input", function () {
        _this.showHideSearch();
      });

      this.deselect_all.on("click", function () {
        _this.deselectEntities();
      });

      this._super();
    },

    open: function () {
      this._super();

      this.input_search.node().value = "";
      this.input_search.node().focus();
      this.showHideSearch();
{'fraction_non_alphanumeric': 0.1555004135649297, 'fraction_numerical': 0.0011028398125172319, 'mean_word_length': 2.393826005612722, 'pattern_counts': {'":': 4, '<': 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': '2139529', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1138, 'n_words': 182}