Remove hidden inputs from the tab order on the stream page

Inputs are given a tabindex of -1 in the handlebars templates, this is
added and removed in the show and hide events of the bootstrap collapse.

(imported from commit 2c54c39edc396d3d18330df4583d901690dd71fa)
This commit is contained in:
Jason Michalski 2014-01-07 12:18:27 -05:00 committed by Waseem Daher
parent 0e7e6610ce
commit 68335d9124
3 changed files with 18 additions and 9 deletions

View File

@ -732,6 +732,15 @@ $(function () {
});
}
// Make all inputs have a default tabindex
subrow.find('.subscription_settings :input').removeAttr('tabindex');
});
$("#subscriptions_table").on("hide", ".subscription_settings", function (e) {
var subrow = $(e.target).closest('.subscription_row');
// Remove all inputs from the tabindex
subrow.find('.subscription_settings :input').attr('tabindex', '-1');
});
$("#subscriptions_table").on("click", ".sub_setting_checkbox", function (e) {

View File

@ -1,10 +1,10 @@
{{#if can_make_public}}
<button class="zulip-button blue-button make-stream-public-button" data-stream-name="{{name}}">
<button class="zulip-button blue-button make-stream-public-button" data-stream-name="{{name}}" tabindex="-1">
Make stream public
</button>
{{/if}}
{{#if can_make_private}}
<button class="zulip-button red-button make-stream-private-button" data-stream-name="{{name}}">
<button class="zulip-button red-button make-stream-private-button" data-stream-name="{{name}}" tabindex="-1">
Make stream private
</button>
{{/if}}

View File

@ -29,19 +29,19 @@
<ul>
<li>
<div id="sub_setting_not_in_home_view" class="sub_setting_checkbox">
<input id="mutestream-{{id}}" class="sub_setting_control" type="checkbox" {{#unless in_home_view}}checked{{/unless}} />
<input id="mutestream-{{id}}" class="sub_setting_control" type="checkbox" tabindex="-1" {{#unless in_home_view}}checked{{/unless}} />
<label class="subscription-control-label">Mute stream</label>
</div>
</li>
<li>
<div id="sub_setting_notifications" class="sub_setting_checkbox">
<input id="notifystream-{{id}}" class="sub_setting_control" type="checkbox" {{#if notifications}}checked{{/if}} />
<input id="notifystream-{{id}}" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if notifications}}checked{{/if}} />
<label class="subscription-control-label">Show desktop notifications<br/>for traffic on this stream</label>
</div>
</li>
<li>
<span class="sub_setting_control">
<input stream_name="{{name}}" class="colorpicker" id="streamcolor" type="text" value="{{color}}" />
<input stream_name="{{name}}" class="colorpicker" id="streamcolor" type="text" value="{{color}}" tabindex="-1" />
</span>
<label for="streamcolor" class="subscription-control-label">Stream color</label>
</li>
@ -61,8 +61,8 @@
<div class="rename-stream">
<span class="sub_settings_title">Administrator settings</span>
<form class="form-inline">
<input type="text" name="new-name" value="" class="input-block new-stream-name" />
<input type="submit" name="rename" value="Rename stream" class="zulip-button red-button stream-rename-button" />
<input type="text" name="new-name" value="" class="input-block new-stream-name" tabindex="-1" />
<input type="submit" name="rename" value="Rename stream" class="zulip-button red-button stream-rename-button" tabindex="-1" />
</form>
</div>
<div class="change-stream-privacy">
@ -75,8 +75,8 @@
<span class="sub_settings_title">Stream membership</span>
<div class="subscriber_list_add">
<form class="form-inline">
<input type="text" name="principal" placeholder="Email address" value="" class="input-block" />
<input type="submit" name="add_subscriber" value="Add" class="zulip-button blue-button add-subscriber-button" />
<input type="text" name="principal" placeholder="Email address" value="" class="input-block" tabindex="-1" />
<input type="submit" name="add_subscriber" value="Add" class="zulip-button blue-button add-subscriber-button" tabindex="-1 "/>
</form>
</div>
</div>