From c3b7419a08349e324143c38241d0205493309bcc Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 27 Jul 2017 17:14:41 -0400 Subject: [PATCH] UX: Remove `hidden` from the `#discourse-modal` when the modal is shown --- app/assets/javascripts/discourse/components/d-modal.js.es6 | 3 ++- .../javascripts/discourse/components/hide-modal-trigger.js.es6 | 2 +- app/assets/javascripts/discourse/templates/modal.hbs | 2 +- app/assets/stylesheets/common/base/modal.scss | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/components/d-modal.js.es6 b/app/assets/javascripts/discourse/components/d-modal.js.es6 index 475c79d0495..1e1a40cdc34 100644 --- a/app/assets/javascripts/discourse/components/d-modal.js.es6 +++ b/app/assets/javascripts/discourse/components/d-modal.js.es6 @@ -2,7 +2,7 @@ import { on } from "ember-addons/ember-computed-decorators"; export default Ember.Component.extend({ elementId: 'discourse-modal', - classNameBindings: [':modal', ':hidden', 'modalClass'], + classNameBindings: [':modal', 'modalClass'], attributeBindings: ['data-keyboard'], // We handle ESC ourselves @@ -17,6 +17,7 @@ export default Ember.Component.extend({ }); this.appEvents.on('modal:body-shown', data => { + this.$().removeClass('hidden'); if (data.title) { this.set('title', I18n.t(data.title)); } else if (data.rawTitle) { diff --git a/app/assets/javascripts/discourse/components/hide-modal-trigger.js.es6 b/app/assets/javascripts/discourse/components/hide-modal-trigger.js.es6 index 0db92cc4617..b077ab7048d 100644 --- a/app/assets/javascripts/discourse/components/hide-modal-trigger.js.es6 +++ b/app/assets/javascripts/discourse/components/hide-modal-trigger.js.es6 @@ -1,6 +1,6 @@ export default Ember.Component.extend({ didInsertElement() { this._super(); - $('#discourse-modal').modal('hide'); + $('#discourse-modal').modal('hide').addClass('hidden'); } }); diff --git a/app/assets/javascripts/discourse/templates/modal.hbs b/app/assets/javascripts/discourse/templates/modal.hbs index cd7b2c616ab..a52aa8276fe 100644 --- a/app/assets/javascripts/discourse/templates/modal.hbs +++ b/app/assets/javascripts/discourse/templates/modal.hbs @@ -1,4 +1,4 @@ -{{#d-modal modalClass=modalClass title=title}} +{{#d-modal modalClass=modalClass title=title class="hidden"}}