<commit_before>import Ember from 'ember';
import Config from 'ember-routable-modal/configuration';

export default Ember.Service.extend({
    routing: Ember.inject.service('-routing'),
    routeName: null,
    activeListener: function() {
        if (typeof Ember.$ !== 'undefined') {
            Ember.$('body')[this.get('routeName') ? 'addClass' : 'removeClass'](Config.modalOpenBodyClassName);
        }
    }.observes('routeName'),
    init() {
        this._super(...arguments);

        if (typeof Ember.$ !== 'undefined' && typeof window !== 'undefined') {
            Ember.$(window).on('popstate.ember-routable-modal', () => {
                if (this.get('routeName')) {
                    this.set('routeName', null);
                }
            });
        }
    },
    clear() {
        if (this.get('routeName')) {
            this.set('routeName', null);
        }
    },
    close() {<commit_msg>Fixing issue with modals not opening from a transition when app uses hash locationType.<commit_after>import Ember from 'ember';
import Config from 'ember-routable-modal/configuration';

export default Ember.Service.extend({
    routing: Ember.inject.service('-routing'),
    routeName: null,
    activeListener: function() {
        if (typeof Ember.$ !== 'undefined') {
            Ember.$('body')[this.get('routeName') ? 'addClass' : 'removeClass'](Config.modalOpenBodyClassName);
        }
    }.observes('routeName'),
    init() {
        this._super(...arguments);

        if (typeof Ember.$ !== 'undefined' && typeof window !== 'undefined') {
            Ember.$(window).on('popstate.ember-routable-modal', () => {
                if (this.get('routeName') !== this.get('routing.router.currentRouteName')) {
                    this.set('routeName', null);
                }
            });
        }
    },
    clear() {
        if (this.get('routeName')) {
            this.set('routeName', null);
        }
    },
    close() {
{'fraction_non_alphanumeric': 0.1716188524590164, 'fraction_numerical': 0.0, 'mean_word_length': 2.265886287625418, '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': '5199118', 'n_tokens_mistral': 560, 'n_tokens_neox': 550, 'n_words': 104}