You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 13, 2021. It is now read-only.
PlugLynn edited this page Apr 19, 2015
·
2 revisions
Code
Changes the current active playlist to the one by the given ID, and reloads it.
varEvents=plugModules.require('plug/core/Events')varPlaylistActionEvents=plugModules.require('plug/events/PlaylistActionEvent')varplaylists=plugModules.require('plug/collections/playlists')functionactivatePlaylist(pid){vartarget=playlists.findWhere({id: pid});// The ACTIVATE event activates the current selected playlist, so we select it firstplaylists.setVisible(target);Events.dispatch(newPlaylistActionEvent(PlaylistActionEvent.ACTIVATE));// activating a playlist doesn't automatically load it, so it shows up as an empty// playlist initially.Events.dispatch(newPlaylistActionEvent(PlaylistActionEvent.LOAD));}