Skip to content

Commit e6ddd9c

Browse files
authored
refactor: remove unnecessary padding from lib component picker (#36073)
Library component picker and Problem bank picker iframe had unnecessary padding resulting in multiple border/shadow in the modal.
1 parent 5ae7187 commit e6ddd9c

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

cms/static/js/views/components/add_library_content.js

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function($, _, gettext, BaseModal) {
2222
// Translators: "title" is the name of the current component being edited.
2323
titleFormat: gettext('Add library content'),
2424
addPrimaryActionButton: false,
25+
showEditorModeButtons: false,
2526
}),
2627

2728
initialize: function() {

cms/static/js/views/modals/select_v2_library_content.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function($, _, gettext, BaseModal) {
1717
viewSpecificClasses: 'modal-add-component-picker confirm',
1818
titleFormat: gettext('Add library content'),
1919
addPrimaryActionButton: false,
20+
showEditorModeButtons: false,
2021
}),
2122

2223
events: {

cms/static/sass/views/_container.scss

+3
Original file line numberDiff line numberDiff line change
@@ -585,13 +585,16 @@
585585
// cms/static/js/views/components/add_library_content_with_picker.js
586586
.modal-add-component-picker {
587587
top: 10%;
588+
padding: 0px !important;
588589
.modal-content {
589590
padding: 0 !important;
591+
border-radius: ($baseline/5);
590592

591593
& > iframe {
592594
width: 100%;
593595
min-height: 80vh;
594596
background: url('#{$static-path}/images/spinner.gif') center center no-repeat;
597+
border-radius: ($baseline/5);
595598
}
596599
}
597600
}

cms/templates/js/basic-modal.underscore

+15-13
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44
<div class="modal-window-overlay"></div>
55
<div class="modal-window <%- viewSpecificClasses %> modal-<%- size %> modal-type-<%- type %>" tabindex="-1" aria-labelledby="modal-window-title">
66
<div class="<%- name %>-modal">
7-
<div class="modal-header">
8-
<h2 id="modal-window-title" class="title modal-window-title">
9-
<%- title %>
10-
<% if (modalSRTitle) { %>
11-
<span class="sr modal-sr-title">
12-
<%- modalSRTitle %>
13-
</span>
7+
<% if (title || modalSRTitle || showEditorModeButtons) { %>
8+
<div class="modal-header">
9+
<h2 id="modal-window-title" class="title modal-window-title">
10+
<%- title %>
11+
<% if (modalSRTitle) { %>
12+
<span class="sr modal-sr-title">
13+
<%- modalSRTitle %>
14+
</span>
15+
<% } %>
16+
</h2>
17+
<% if (showEditorModeButtons) { %>
18+
<ul class="editor-modes action-list action-modes">
19+
</ul>
1420
<% } %>
15-
</h2>
16-
<% if (showEditorModeButtons) { %>
17-
<ul class="editor-modes action-list action-modes">
18-
</ul>
19-
<% } %>
20-
</div>
21+
</div>
22+
<% } %>
2123
<div class="modal-content">
2224
</div>
2325
<div class="modal-actions">

0 commit comments

Comments
 (0)