This commit is contained in:
Barış Soner Uşaklı
2018-02-15 12:46:04 -05:00
parent 854f79142e
commit a224c557c0
3 changed files with 19 additions and 1 deletions

View File

@@ -65,5 +65,7 @@
"alert.find-user": "Find a User",
"alert.user-search": "Search for a user here...",
"alert.find-group": "Find a Group",
"alert.group-search": "Search for a group here..."
"alert.group-search": "Search for a group here...",
"collapse-all": "Collapse All",
"expand-all": "Expand All"
}

View File

@@ -37,6 +37,20 @@ define('admin/manage/categories', ['vendor/jquery/serializeObject/jquery.ba-seri
el.find('i').toggleClass('fa-minus').toggleClass('fa-plus');
el.closest('[data-cid]').find('> ul[data-cid]').toggleClass('hidden');
});
$('#collapse-all').on('click', function () {
toggleAll(false);
});
$('#expand-all').on('click', function () {
toggleAll(true);
});
function toggleAll(expand) {
var el = $('.categories .toggle');
el.find('i').toggleClass('fa-minus', expand).toggleClass('fa-plus', !expand);
el.closest('[data-cid]').find('> ul[data-cid]').toggleClass('hidden', !expand);
}
};
Categories.throwCreateModal = function () {

View File

@@ -1,3 +1,5 @@
<button id="collapse-all" class="btn btn-default">[[admin/manage/categories:collapse-all]]</button> <button id="expand-all" class="btn btn-default">[[admin/manage/categories:expand-all]]</button>
<hr/>
<div class="categories"></div>
<button data-action="create" class="floating-button mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">