<commit_before><link rel="import" href="../../../bower_components/polymer/lib/utils/render-status.html">
<link rel="import" href="../../../bower_components/etools-behaviors/etools-logs-mixin.html">
<link rel="import" href="etools-toast.html">
<script>
  'use strict';

  window.EtoolsPmpApp = window.EtoolsPmpApp || {};
  window.EtoolsPmpApp.Mixins = window.EtoolsPmpApp.Mixins || {};

  /**
   * Toast notifications functionality mixin
   * @polymer
   * @mixinFunction
   * @appliesMixin EtoolsLogsMixin
   */
  EtoolsPmpApp.Mixins.ToastNotifications = Polymer.dedupingMixin(
      superClass => class extends EtoolsLogsMixin(superClass) {
        static get properties() {
          return {
            _toast: {
              type: Object,
              value: null
            },
            _toastQueue: {
              type: Array,
              value: function() {
                return [];
              }
            },
            currentToastMessage: {
              type: String,
              value: ''
            }
          };
        }

        ready() {
          super.ready();
          this.addEventListener('toast', this.queueToast);
        }

        queueToast(e) {
          e.stopPropagation();
          let detail = e.detail;
          if (!this._toast) {
            this._createToastElement();
          }

          if (!this._toastQueue.length) {
            this.push('_toastQueue', detail);
            let toastProperties = this._toast.prepareToastAndGetShowProperties(detail);
            this._showToast(toastProperties);
          } else {
            let alreadyInQueue = this._toastQueue.filter(function(toastDetail) {
              return JSON.stringify(toastDetail) === JSON.stringify(detail);
            });
            if (alreadyInQueue.length === 0) {
              this.push('_toastQueue', detail);
            } // else already in the queue
          }
        }

        _createToastElement() {
          this._toast = document.createElement('etools-toast');
          this._toast.set('fitInto', this.$.appHeadLayout);
          this._toast.addEventListener('toast-confirm', this._toggleToast.bind(this, this._toast));
          document.querySelector('body').appendChild(this._toast);

          this._toastAfterRenderSetup();<commit_msg>Fixed an issue with toast messages not being visible in IE [ch6019]<commit_after><link rel="import" href="../../../bower_components/polymer/lib/utils/render-status.html">
<link rel="import" href="../../../bower_components/etools-behaviors/etools-logs-mixin.html">
<link rel="import" href="etools-toast.html">
<script>
  'use strict';

  window.EtoolsPmpApp = window.EtoolsPmpApp || {};
  window.EtoolsPmpApp.Mixins = window.EtoolsPmpApp.Mixins || {};

  /**
   * Toast notifications functionality mixin
   * @polymer
   * @mixinFunction
   * @appliesMixin EtoolsLogsMixin
   */
  EtoolsPmpApp.Mixins.ToastNotifications = Polymer.dedupingMixin(
      superClass => class extends EtoolsLogsMixin(superClass) {
        static get properties() {
          return {
            _toast: {
              type: Object,
              value: null
            },
            _toastQueue: {
              type: Array,
              value: function() {
                return [];
              }
            },
            currentToastMessage: {
              type: String,
              value: ''
            }
          };
        }

        ready() {
          super.ready();
          this.addEventListener('toast', this.queueToast);
        }

        queueToast(e) {
          e.stopPropagation();
          let detail = e.detail;
          if (!this._toast) {
            this._createToastElement();
          }

          if (!this._toastQueue.length) {
            this.push('_toastQueue', detail);
            let toastProperties = this._toast.prepareToastAndGetShowProperties(detail);
            this._showToast(toastProperties);
          } else {
            let alreadyInQueue = this._toastQueue.filter(function(toastDetail) {
              return JSON.stringify(toastDetail) === JSON.stringify(detail);
            });
            if (alreadyInQueue.length === 0) {
              this.push('_toastQueue', detail);
            } // else already in the queue
          }
        }

        _createToastElement() {
          this._toast = document.createElement('etools-toast');
          this._toast.addEventListener('toast-confirm', this._toggleToast.bind(this, this._toast));
          document.querySelector('body').appendChild(this._toast);
          if (!this.isIE) {
            this._toast.set('fitInto', this.$.appHeadLayout);
          }

          this._toastAfterRenderSetup();
{'fraction_non_alphanumeric': 0.12644169158479282, 'fraction_numerical': 0.0012815036309269544, 'mean_word_length': 1.8889574336829118, 'pattern_counts': {'":': 0, '<': 11, '<?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': '5830554', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1293, 'n_words': 204}