From 149c1490941b92faa0b028a3b1804ba20494a179 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 12 May 2015 17:07:56 -0700 Subject: [PATCH] Select input for select series in manual import --- src/UI/ManualImport/Series/SelectSeriesLayout.js | 5 +++++ src/UI/Shared/Modal/ModalRegionBase.js | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/UI/ManualImport/Series/SelectSeriesLayout.js b/src/UI/ManualImport/Series/SelectSeriesLayout.js index ff4541a96..126a16c6a 100644 --- a/src/UI/ManualImport/Series/SelectSeriesLayout.js +++ b/src/UI/ManualImport/Series/SelectSeriesLayout.js @@ -35,6 +35,7 @@ module.exports = Marionette.Layout.extend({ }); this.listenTo(this.seriesCollection, 'row:selected', this._onSelected); + this.listenTo(this, 'modal:afterShow', this._setFocus); }, onRender : function() { @@ -88,5 +89,9 @@ module.exports = Marionette.Layout.extend({ this.trigger('manualimport:selected:series', { model: e.model }); vent.trigger(vent.Commands.CloseModal2Command); + }, + + _setFocus : function () { + this.ui.filter.focus(); } }); \ No newline at end of file diff --git a/src/UI/Shared/Modal/ModalRegionBase.js b/src/UI/Shared/Modal/ModalRegionBase.js index ae1fd2b1e..01b92a67f 100644 --- a/src/UI/Shared/Modal/ModalRegionBase.js +++ b/src/UI/Shared/Modal/ModalRegionBase.js @@ -1,3 +1,4 @@ +var _ = require('underscore'); var $ = require('jquery'); var Backbone = require('backbone'); var Marionette = require('marionette'); @@ -33,7 +34,10 @@ var region = Marionette.Region.extend({ this.currentView.$el.addClass('modal-dialog'); - this.trigger('modal:afterShow'); + this.$el.on('shown.bs.modal', _.bind(function() { + this.trigger('modal:afterShow'); + this.currentView.trigger('modal:afterShow'); + }, this)); }, closeModal : function() { @@ -44,6 +48,7 @@ var region = Marionette.Region.extend({ _closing : function() { if (this.$el) { this.$el.off('hide.bs.modal'); + this.$el.off('shown.bs.modal'); } this.reset();