From 7284ef50ebfd1c62a362d9ed386d218b81eb96c4 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 17 Apr 2016 14:54:51 -0700 Subject: [PATCH] Fixed: Manual Import not scrolling after using file browser Closes #745 --- src/UI/Shared/Modal/ModalRegion2.js | 8 ++++++++ src/UI/Shared/Modal/ModalRegionBase.js | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/src/UI/Shared/Modal/ModalRegion2.js b/src/UI/Shared/Modal/ModalRegion2.js index e9ee8f81f..f9f38bea4 100644 --- a/src/UI/Shared/Modal/ModalRegion2.js +++ b/src/UI/Shared/Modal/ModalRegion2.js @@ -16,6 +16,14 @@ var region = ModalRegionBase.extend({ this.$el.on('shown.bs.modal', function() { $('.modal-backdrop:last').css('z-index', 1059); }); + }, + + _closed : function () { + ModalRegionBase.prototype._closed.apply(this, arguments); + + if (require('../../AppLayout').modalRegion.currentView) { + $('body').addClass('modal-open'); + } } }); diff --git a/src/UI/Shared/Modal/ModalRegionBase.js b/src/UI/Shared/Modal/ModalRegionBase.js index 01b92a67f..91c8ab32d 100644 --- a/src/UI/Shared/Modal/ModalRegionBase.js +++ b/src/UI/Shared/Modal/ModalRegionBase.js @@ -31,6 +31,7 @@ var region = Marionette.Region.extend({ }); this.$el.on('hide.bs.modal', $.proxy(this._closing, this)); + this.$el.on('hidden.bs.modal', $.proxy(this._closed, this)); this.currentView.$el.addClass('modal-dialog'); @@ -52,6 +53,12 @@ var region = Marionette.Region.extend({ } this.reset(); + }, + + _closed: function () { + if (this.$el) { + this.$el.off('hidden.bs.modal'); + } } });