Skip to content

Commit

Permalink
fix: hide expando button if no subcategories; remove attempt at estab…
Browse files Browse the repository at this point in the history
…lishing common vars, increased spacing between categories in list
  • Loading branch information
julianlam committed Jul 25, 2022
1 parent 741e8c8 commit 89c11a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions public/less/admin/manage/categories.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ div.categories {
}
}
> li {
margin: @acp-base-line 0;
margin: 16px 0 24px 0;

&.placeholder {
border: 1px dashed #2196F3;
Expand All @@ -37,7 +37,7 @@ div.categories {
li {
min-height: 0;
display: inline;
margin: 0 @acp-margin 0 0;
margin: 0 16px 0 0;
left: 0;
}
}
Expand Down Expand Up @@ -93,7 +93,7 @@ div.categories {

.category-header {
margin-top: 0;
margin-bottom: @acp-base-line;
margin-bottom: 8px;
}

.description {
Expand Down
3 changes: 0 additions & 3 deletions public/less/admin/vars.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
@acp-base-line: 8px;
@acp-line-height: @acp-base-line * 6;
@acp-margin: @acp-base-line * 2;
// system font family
// based on those in [bootstrap@5.0.0-alpha1](https://github.com/twbs/bootstrap/blob/b531bda07cbea2e124194aefe3b8597b3ac2578e/scss/_variables.scss#L386)
// and [wordpress admin](https://core.trac.wordpress.org/browser/trunk/src/wp-admin/css/common.css?rev=47835#L220)
Expand Down
6 changes: 6 additions & 0 deletions public/src/admin/manage/categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ define('admin/manage/categories', [
}, function (html) {
container.append(html);

// Disable expand toggle
if (!categories.length) {
const toggleEl = container.get(0).querySelector('.toggle');
toggleEl.remove();
}

// Handle and children categories in this level have
for (let x = 0, numCategories = categories.length; x < numCategories; x += 1) {
renderList(categories[x].children, $('li[data-cid="' + categories[x].cid + '"]'), categories[x]);
Expand Down

0 comments on commit 89c11a1

Please sign in to comment.