Skip to content

Commit

Permalink
APIs & events to enable Audio Player add-ons #408
Browse files Browse the repository at this point in the history
  • Loading branch information
Rello committed Jun 28, 2019
1 parent 9cb37d9 commit 2ae4052
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* @copyright 2016-2019 Marcel Scherello
*/

'use strict';

if (!OCA.Audioplayer) {
/**
* @namespace
Expand Down Expand Up @@ -59,10 +61,9 @@ OCA.Audioplayer.Sidebar = {
starIcon.on('click', $this.favoriteUpdate.bind($this));

if ($appsidebar.data('trackid') === '') {
$('#sidebarClose').on('click', OCA.Audioplayer.Sidebar.hideSidebar.bind($this));
$('#sidebarClose').on('click', OCA.Audioplayer.Sidebar.hideSidebar);

OCA.Audioplayer.Sidebar.constructTabs();
// noinspection JSUnresolvedFunction
$('#tabHeaderMetadata').addClass('selected');
OC.Apps.showAppSidebar();
}
Expand All @@ -88,7 +89,7 @@ OCA.Audioplayer.Sidebar = {
class: 'addonsTabView',
tabindex: '9',
name: t('audioplayer', 'Add-ons'),
action: OCA.Audioplayer.Sidebar.addonsTabView.bind($this),
action: OCA.Audioplayer.Sidebar.addonsTabView,
});

OCA.Audioplayer.Sidebar.registerSidebarTab({
Expand All @@ -107,7 +108,7 @@ OCA.Audioplayer.Sidebar = {
action: OCA.Audioplayer.Sidebar.playlistsTabView,
});

items = _.map(OCA.Audioplayer.Sidebar.sidebar_tabs, function (item) {
var items = _.map(OCA.Audioplayer.Sidebar.sidebar_tabs, function (item) {
return item;
});
items.sort(OCA.Audioplayer.Sidebar.sortByName);
Expand All @@ -127,12 +128,11 @@ OCA.Audioplayer.Sidebar = {
'id': items[tab].class
});
$('.tabsContainer').append(div);
$('#' + items[tab].id).on('click', items[tab].action.bind($this));
$('#' + items[tab].id).on('click', items[tab].action);
}
},

hideSidebar: function () {
// noinspection JSUnresolvedFunction
$('#app-sidebar').data('trackid', '');
OC.Apps.hideAppSidebar();
$('.tabHeaders').empty();
Expand Down Expand Up @@ -306,7 +306,7 @@ OCA.Audioplayer.Sidebar = {
});
$('.tabsContainer').append(div);

$('#tabHeaderSONOS').on('click', OCA.Audioplayer.Sidebar.SONOSTabView.bind($this));
$('#tabHeaderSONOS').on('click', OCA.Audioplayer.Sidebar.SONOSTabView);
},
SONOSTabView: function () {
var trackid = $('#app-sidebar').data('trackid');
Expand Down

0 comments on commit 2ae4052

Please sign in to comment.