Focus the schedule dialog box when it pops up

Gives the schedule dialog box a tabIndex of 0 so that
it can be focused, and then focuses it.
The call to focus is in render, since I couldn't figure out
how to place it in initialize, since not enough is loaded yet.
That might be a horrible mistake, please fix that.

Now the dialog box closes when esc is pressed, like normal.

Fixes #196
In regards to doing it for all the models, I think that it was some
interaction with the input box or the code for that particular popup.  Be
default, it does work on all models.  (That's why I only needed to fix the
focus, not adding the dismisal code).


On Sun, Jul 27, 2014 at 3:41 PM, Tyr <tyr.god.of.war42@gmail.com> wrote:

> 0 is a special value, which means to assign it a value.  I would agree if
> it was given a  tabIndex of 1.
>
> I did try to set it in the html template, but it didn't work, at least in
> my first try.  I could have made a error in adding it.
>
>
> On Sun, Jul 27, 2014 at 2:48 PM, David Hu <notifications@github.com>
> wrote:
>
>> In server/static/js/schedule.js:
>>
>> > @@ -692,6 +692,9 @@ function(RmcBackbone, $, _, _s, _bootstrap, _user, _course, _util, _facebook,
>> >        this.$el.html(this.template({}));
>> >        this.$('.schedule-input-placeholder')
>> >          .replaceWith(this.scheduleInputView.render().el);
>> > +      var dialogbox = this.$('.schedule-input-modal');
>> > +      dialogbox.prop('tabIndex', '0');
>> > +      dialogbox.focus(); // TODO(tbelaire) Can this be moved into initialize?
>>
>> Probably since it comes first in the tab order, the browser focuses it as
>> if it were the first input element to interact with.
>>
>> —
>> Reply to this email directly or view it on GitHub
>> <https://github.com/UWFlow/rmc/pull/197/files#r15440846>.
>>
>
>