<commit_before>import Ember from 'ember';

export default Ember.Component.extend({
  modalWindowHeight: undefined,
  modalWindowWidth: undefined,
  modalWindowContentHeight: 400,
  modalWindowHeightComputed: Ember.computed('modalWindowHeight', function() {
    var height = this.get('modalWindowHeight');
    if (height && typeof height === 'number') {
      return height;
    }

    return 600;
  }),
  modalWindowWidthComputed: Ember.computed('modalWindowWidth', function() {
    var width = this.get('modalWindowWidth');
    if (width && typeof width === 'number') {
      return width;
    }

    return 750;
  }),
  modalWindowContentHeightComputed: Ember.computed('modalWindowContentHeight', function() {
    var height = this.get('modalWindowContentHeight');
    if (height && typeof height === 'number') {
      return height;
    }

    return 400;
  }),
  didInsertElement: function() {
      var _this = this;
      this.$('.ui.modal').modal('setting', {
        onApprove: function() {
          _this.sendAction('ok');
        },
        onDeny: function() {
          _this.sendAction('close');
        },
        onHidden: function() {
          _this.sendAction('close');
        },
        onVisible: function() {
          var wholeHeight = Ember.$(this).height();
          var headHeight = Ember.$('.header', this).height();
          var actionsHeight = Ember.$('.actions', this).height();
          var closeHeight = Ember.$('.close', this).height();
          var result = wholeHeight - headHeight - actionsHeight - closeHeight - 50;
          _this.set('modalWindowContentHeight', result);
        }
      }).modal('show');
    }
});
<commit_msg>Fixed appearing new record on DOM each lookup call<commit_after>import Ember from 'ember';

export default Ember.Component.extend({
  modalWindowHeight: undefined,
  modalWindowWidth: undefined,
  modalWindowContentHeight: 400,
  modalWindowHeightComputed: Ember.computed('modalWindowHeight', function() {
    var height = this.get('modalWindowHeight');
    if (height && typeof height === 'number') {
      return height;
    }

    return 600;
  }),
  modalWindowWidthComputed: Ember.computed('modalWindowWidth', function() {
    var width = this.get('modalWindowWidth');
    if (width && typeof width === 'number') {
      return width;
    }

    return 750;
  }),
  modalWindowContentHeightComputed: Ember.computed('modalWindowContentHeight', function() {
    var height = this.get('modalWindowContentHeight');
    if (height && typeof height === 'number') {
      return height;
    }

    return 400;
  }),
  didInsertElement: function() {
      var _this = this;
      this.$('.ui.modal').modal('setting', {
        onApprove: function() {
          _this.sendAction('ok');
        },
        onDeny: function() {
          _this.sendAction('close');
        },
        onHidden: function() {
          _this.sendAction('close');
          this.remove();
        },
        onVisible: function() {
          var wholeHeight = Ember.$(this).height();
          var headHeight = Ember.$('.header', this).height();
          var actionsHeight = Ember.$('.actions', this).height();
          var closeHeight = Ember.$('.close', this).height();
          var result = wholeHeight - headHeight - actionsHeight - closeHeight - 50;
          _this.set('modalWindowContentHeight', result);
        }
      }).modal('show');
    }
});

{'fraction_non_alphanumeric': 0.14571092831962398, 'fraction_numerical': 0.008225616921269096, 'mean_word_length': 2.770764119601329, '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': '2864165', 'n_tokens_mistral': 965, 'n_tokens_neox': 930, 'n_words': 209}