From 14004fbf7f9762dab6b8ecd7f39fb6c9565dd5e0 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 27 Sep 2021 11:13:16 +0000 Subject: support un-starring of apps in app bin --- view/tpl/navbar_default.tpl | 53 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 7 deletions(-) (limited to 'view/tpl/navbar_default.tpl') 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}} {{/foreach}} {{/if}} @@ -188,6 +188,7 @@ {{/if}} +
@@ -210,10 +211,10 @@
{{/if}} {{if $is_owner}} +
- {{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; -- cgit v1.2.3