if (this.$flags && this.$comment) {
this.selects = [...this.$flags.querySelectorAll('.flag_select')];
this.selects.forEach($select => $select.addEventListener('change', () => this.flag_onselect($select)));
+ this.$fieldset_wrapper = this.$flags.parentElement.appendChild(document.createElement('div'));
+ this.$fieldset_wrapper.id = 'approval-request-fieldset-wrapper';
+ this.$comment_wrapper = document.querySelector('#smallCommentFrame') || this.$comment.parentElement;
this.$comment.form.addEventListener('submit', () => this.form_onsubmit());
}
}
* @type {Array<HTMLFieldSetElement>}
*/
get inserted_fieldsets() {
- return [...this.$flags.parentElement.querySelectorAll('fieldset.approval-request')];
+ return [...this.$fieldset_wrapper.querySelectorAll('fieldset.approval-request')];
}
/**
$fieldset = this.find_available_fieldset(name);
if ($fieldset) {
- this.$flags.parentElement.appendChild($fieldset);
+ this.$fieldset_wrapper.appendChild($fieldset);
}
}
this.add_comment(text);
}
}
+
+ // Hide the original comment form when one or more `<fieldset>`s are inserted
+ this.$comment_wrapper.hidden = this.inserted_fieldsets.length > 0;
}
/**
* This Source Code Form is "Incompatible With Secondary Licenses", as
* defined by the Mozilla Public License, v. 2.0. */
+#approval-request-fieldset-wrapper {
+ margin: 0 0 0 16px;
+}
+
+#approval-request-fieldset-wrapper:empty {
+ display: none;
+}
+
fieldset.approval-request {
- margin: 1em 0;
+ margin: 0 0 8px;
+}
+
+fieldset.approval-request:last-child {
+ margin: 0;
}
fieldset.approval-request legend {
font-weight: bold;
}
+fieldset.approval-request table {
+ width: 100%;
+}
+
fieldset.approval-request th {
padding: .4em;
width: 20em;
}
fieldset.approval-request input.long[type="text"] {
- width: 40em;
+ width: 100%;
}
fieldset.approval-request textarea {
- width: 40em;
+ width: 100%;
min-height: 5em;
font-size: inherit;
line-height: inherit;
margin: .4em;
text-align: right;
}
+
+@media screen and (max-width: 1023px) {
+ #approval-request-fieldset-wrapper {
+ margin: 16px 0 0 0;
+ }
+}
[% RETURN UNLESS type.name == 'review' %]
-<span id="[% fid FILTER none %]_suggestions" style="display: none">
+<span id="[% fid FILTER none %]_suggestions" class="reviewer-suggestions" style="display: none">
<a href="#" id="[% fid FILTER none %]_suggestions_link">suggested reviewers ▾</a>
</span>
.mentor {
font-weight: bold;
}
+
+.reviewer-suggestions {
+ display: block;
+ margin: 4px 0;
+}
display: block;
}
-#smallCommentFrame {
- margin-right: 1.5em;
+#attachment_actions {
+ clear: both;
+ margin-bottom: 1ex;
}
-#attachment_comments_and_flags, #attachment_actions {
+#attachment_comments_and_flags {
+ display: flex;
+ overflow: hidden;
clear: both;
- margin-bottom: 1ex;
+ margin: 16px 0;
+}
+
+#attachment_comments_and_flags > * {
+ flex: auto;
}
#attachment_information_read_only .title {
float: left;
}
-#smallCommentFrame textarea {
+#smallCommentFrame {
+ margin: 0 0 0 16px;
+}
+
+#smallCommentFrame #comment,
+#smallCommentFrame #comment_preview {
display: block;
+ box-sizing: border-box;
+ width: 100% !important;
}
textarea.bz_private {
}
#attachment_flags {
- margin-bottom: 1em;
+ display: flex;
+}
+
+#attachment_flags > * {
+ flex: auto;
}
#attachment_flags p {
#att-error-message:empty {
margin: 0;
}
+
+@media screen and (max-width: 1023px) {
+ #attachment_comments_and_flags,
+ #attachment_flags {
+ display: block;
+ }
+
+ #smallCommentFrame {
+ margin: 16px 0 0 0;
+ }
+}
[% END %]
</div>
<div id="attachment_comments_and_flags">
+ <div id="attachment_flags">
+ [% IF attachment.flag_types.size > 0 %]
+ [% PROCESS "flag/list.html.tmpl" flag_types = attachment.flag_types, read_only_flags = !can_edit %]
+ [% END %]
+ </div>
[% IF user.id %]
<div id="smallCommentFrame">
<label for="comment">Comment (on the [% terms.bug %]):</label>
[% Hook.process('after_comment_textarea') %]
</div>
[% END %]
- <div id="attachment_flags">
- [% IF attachment.flag_types.size > 0 %]
- [% PROCESS "flag/list.html.tmpl" flag_types = attachment.flag_types
- read_only_flags = !can_edit
- %]
-
- [% END %]
- </div>
-
- [% Hook.process('form_before_submit') %]
-
- [% IF user.id %]
- <div id="update_container">
- <input type="submit" value="Submit" id="update">
- </div>
- [% END %]
</div>
</div>
</div>
+
+ [% Hook.process('form_before_submit') %]
+
+ [% IF user.id %]
+ <div id="update_container">
+ <input type="submit" value="Submit" id="update">
+ </div>
+ [% END %]
</form>
<div id="attachment_actions">