diff options
author | Mario <mario@mariovavti.com> | 2021-09-27 11:13:16 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-09-27 11:13:16 +0000 |
commit | 14004fbf7f9762dab6b8ecd7f39fb6c9565dd5e0 (patch) | |
tree | 5d862a6de823c1f68641c3346793fb5281bb7d48 /view/tpl/navbar_default.tpl | |
parent | 73e8af98f21f69195f723782c69243e0d7237780 (diff) | |
download | volse-hubzilla-14004fbf7f9762dab6b8ecd7f39fb6c9565dd5e0.tar.gz volse-hubzilla-14004fbf7f9762dab6b8ecd7f39fb6c9565dd5e0.tar.bz2 volse-hubzilla-14004fbf7f9762dab6b8ecd7f39fb6c9565dd5e0.zip |
support un-starring of apps in app bin
Diffstat (limited to 'view/tpl/navbar_default.tpl')
-rw-r--r-- | view/tpl/navbar_default.tpl | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/view/tpl/navbar_default.tpl b/view/tpl/navbar_default.tpl index eae74daca..e2cda2db7 100644 --- a/view/tpl/navbar_default.tpl +++ b/view/tpl/navbar_default.tpl @@ -157,7 +157,7 @@ {{if $navbar_apps}} {{foreach $navbar_apps as $navbar_app}} <li class="nav-app-sortable"> - {{$navbar_app}} + {{$navbar_app}} </li> {{/foreach}} {{/if}} @@ -188,6 +188,7 @@ </div> {{/if}} </div> + <i id="app-bin-trash" class="fa fa-2x fa-fw fa-trash-o d-none"></i> <button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button> </div> <div class="offcanvas-body pt-0"> @@ -210,10 +211,10 @@ </div> {{/if}} {{if $is_owner}} + <div class="dropdown-header text-uppercase"> + {{$featured_apps}} + </div> <div id="app-bin-container" data-token="{{$form_security_token}}"> - <div class="dropdown-header text-uppercase"> - {{$featured_apps}} - </div> {{foreach $nav_apps as $nav_app}} {{$nav_app}} {{/foreach}} @@ -237,14 +238,19 @@ animation: 150, delay: 200, delayOnTouchOnly: true, + onStart: function (e) { + $('#app-bin-trash').removeClass('d-none'); + }, onEnd: function (e) { + $('#app-bin-trash').addClass('d-none'); + let app_str = ''; - $('#app-bin-container a').each(function () { + $('#app-bin-container a:visible').each(function () { if(app_str.length) { - app_str = app_str.concat(',', $(this).text()); + app_str = app_str.concat(',', this.text); } else { - app_str = app_str.concat($(this).text()); + app_str = app_str.concat(this.text); } }); $.post( @@ -388,6 +394,39 @@ }); + + $('#app-bin-trash').on('dragover', function (e) { + e.preventDefault(); + e.stopPropagation(); + + $('#app-bin-container a[href=\'' + app_url + '\']').fadeOut(); + }); + $('#app-bin-trash').on('dragleave', function (e) { + e.preventDefault(); + e.stopPropagation(); + + $('#app-bin-container a[href=\'' + app_url + '\']').fadeIn(); + + }); + $('#app-bin-trash').on('drop', function (e) { + e.preventDefault(); + e.stopPropagation(); + + if (papp === null) + return; + + $.ajax({ + type: 'post', + url: 'appman', + data: { + 'aj' : 1, + 'feature' : 'nav_featured_app', + 'papp' : papp + } + }); + + }); + var papp, app_icon, app_url; $(document).on('dragstart', function (e) { papp = e.target.dataset.papp || null; |