<commit_before>import Ember from 'ember';
import { isSafari } from 'ui/utils/platform';

const DELAY = 1000;
const DEFAULT_TEXT = 'copyToClipboard.tooltip';

export default Ember.Component.extend({
  tagName          : 'span',

  model            : null,

  /*Component Params*/
  buttonText       : null,
  tooltipText      : null,
  status           : null,
  size             : null,
  target           : null,
  clipboardText    : null,
  textChangedEvent : null,

  mouseEnter() {
    this.set('model', new Object({tooltipText: DEFAULT_TEXT}));
  },

  click: function(evt) {
    this.set('textChangedEvent', Ember.$(evt.currentTarget));
  },

  isSupported: function() {
    return this.get('clipboardText.length') && (!isSafari || document.queryCommandSupported('copy'));
  }.property('clipboardText'),

  actions: {
    alertSuccess: function() {
      this.set('status', 'success');
      let orig = this.get('model.tooltipText');
      this.set('model', new Object({tooltipText: 'copyToClipboard.copied'}));

      Ember.run.later(() =>{
        this.set('status', null);
        this.set('model', new Object({tooltipText: orig}));
      }, DELAY);
    },
  },
});<commit_msg>Init bug for copy inline component<commit_after>import Ember from 'ember';
import { isSafari } from 'ui/utils/platform';

const DELAY = 1000;
const DEFAULT_TEXT = 'copyToClipboard.tooltip';

export default Ember.Component.extend({
  tagName          : 'span',

  model            : null,

  /*Component Params*/
  buttonText       : null,
  tooltipText      : null,
  status           : null,
  size             : null,
  target           : null,
  clipboardText    : null,
  textChangedEvent : null,

  init() {
    this._super(...arguments);
    this.set('model', new Object({tooltipText: DEFAULT_TEXT}));
  },

  mouseEnter() {
    this.set('model', new Object({tooltipText: DEFAULT_TEXT}));
  },

  isSupported: function() {
    return this.get('clipboardText.length') && (!isSafari || document.queryCommandSupported('copy'));
  }.property('clipboardText'),

  actions: {
    alertSuccess: function() {
      let orig = this.get('model.tooltipText');

      this.setProperties({
        status: 'success',
        model: {tooltipText: 'copyToClipboard.copied'}
      });

      Ember.run.later(() =>{
        this.setProperties({
          status: null,
          model: {tooltipText: orig}
        });
      }, DELAY);
    },
  },
});
{'fraction_non_alphanumeric': 0.15257731958762888, 'fraction_numerical': 0.0032989690721649486, 'mean_word_length': 2.7151607963246556, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6801021', 'n_tokens_mistral': 760, 'n_tokens_neox': 729, 'n_words': 153}