Skip to content

Commit c59dba1

Browse files
committed
v2-Beta12 release
1 parent dfa3cbe commit c59dba1

File tree

6 files changed

+625
-481
lines changed

6 files changed

+625
-481
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Frappe Better Attach Control
22

3-
A small plugin for Frappe that adds the support of customizations to the attach control.
3+
A small plugin for Frappe that adds customization to the attach control.
4+
It supports RTL layout and dark mode out of the box.
45

56
⚠️ **v2 is still in BETA stage** ⚠️
67

@@ -187,7 +188,8 @@ bench restart
187188
| `disable_reload()` | Deny reloading attachments and hide reload button (Frappe >= v13.0.0). |
188189
| `enable_remove()` | Allow removing and clearing attachments and show the clear and remove buttons. |
189190
| `disable_remove()` | Deny removing and clearing attachments and hide the clear and remove buttons. |
190-
| `show_files()` | Show the list of uploaded files in a dialog (Only when multiple files is allowed). |
191+
| `show_files()` | Open the uploaded files list and preview dialog (Only when multiple files is allowed). |
192+
| `show_preview()` | Open the preview dialog of the uploaded file (Only when multiple files is not allowed). |
191193
| `set_options(JSON)` | Set or change the plugin current options. |
192194

193195
---

frappe_better_attach_control/public/css/better_attach.bundle.css

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,67 +7,70 @@
77

88

99
.ba-hidden {
10-
display: none;
10+
display: none !important;
1111
}
12-
.ba-dialog-back {
13-
display: inline-block;
14-
margin-right: 1.5rem !important;
12+
.ba-hidden-overflow {
13+
overflow: hidden;
1514
}
16-
html[dir="rtl"] .ba-dialog-back {
17-
margin-left: 1.5rem !important;
18-
margin-right: 0;
19-
transform: rotate(180deg);
15+
.ba-preview-holder {
16+
height: 50%;
17+
}
18+
.ba-preview-file {
19+
max-width: 100%;
20+
height: auto;
21+
}
22+
.ba-attachment {
23+
padding-top: 8px !important;
24+
padding-bottom: 8px !important;
25+
border-bottom: 1px solid #e5e5e5;
26+
}
27+
.ba-attachment:first-child {
28+
padding-top: 0;
29+
}
30+
.ba-attachment:last-child {
31+
padding-bottom: 0;
32+
border-bottom: 0;
2033
}
2134
.ba-link, .ba-link:hover {
2235
text-decoration: none;
2336
}
24-
.ba-filename {
37+
.ba-link {
38+
max-width: 100%;
39+
white-space: nowrap;
40+
overflow: hidden;
41+
text-overflow: ellipsis;
42+
vertical-align: middle;
2543
color: #000;
2644
font-size: .9rem;
2745
font-weight: 300;
2846
line-height: 1.2;
29-
display: -moz-box;
30-
display: -webkit-box;
31-
overflow: hidden;
32-
text-overflow: ellipsis;
33-
-o-box-orient: vertical;
34-
-o-line-clamp: 1;
35-
-moz-box-orient: vertical;
36-
-moz-line-clamp: 1;
37-
-webkit-box-orient: vertical;
38-
-webkit-line-clamp: 1;
39-
}
40-
[data-theme="dark"] .ba-filename {
41-
color: #fff;
4247
}
43-
.ba-file-link {
44-
color: #bababa;
45-
font-size: .8rem;
46-
}
47-
[data-theme="dark"] .ba-file-link {
48-
color: #e9e9e9;
48+
[data-theme="dark"] .ba-link {
49+
color: #fff;
4950
}
5051
.ba-meta {
52+
padding: 0;
5153
color: #000;
5254
font-size: .7rem;
5355
font-weight: 300;
54-
line-height: 1.2;
56+
text-align: center;
5557
}
5658
[data-theme="dark"] .ba-meta {
5759
color: #fff;
5860
}
5961
.ba-file {
60-
width: 30px;
61-
height: 30px;
62-
margin-left: 5px;
62+
width: 25px !important;
63+
height: 25px !important;
64+
margin-left: 0;
65+
margin-right: 10px;
6366
background-position: center center;
6467
background-repeat: no-repeat;
6568
background-size: contain;
6669
background-attachment: fixed;
6770
}
6871
html[dir="rtl"] .ba-file {
69-
margin-left: 0;
70-
margin-right: 5px;
72+
margin-left: 10px;
73+
margin-right: 0;
7174
}
7275
.ba-image {
7376
background-image: url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="0.75em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 384 512"%3E%3Cpath fill="%2324c824" d="M64 0C28.7 0 0 28.7 0 64v384c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V160H256c-17.7 0-32-14.3-32-32V0H64zm192 0v128h128L256 0zM128 256c0 17.7-14.3 32-32 32s-32-14.3-32-32s14.3-32 32-32s32 14.3 32 32zm88 32c5.3 0 10.2 2.6 13.2 6.9l88 128c3.4 4.9 3.7 11.3 1 16.5S310 448 304 448H80c-5.8 0-11.1-3.1-13.9-8.1s-2.8-11.2.2-16.1l48-80c2.9-4.8 8.1-7.8 13.7-7.8s10.8 2.9 13.7 7.8l12.8 21.4l48.3-70.2c3-4.3 7.9-6.9 13.2-6.9z"%2F%3E%3C%2Fsvg%3E');

0 commit comments

Comments
 (0)