Skip to content

Instantly share code, notes, and snippets.

@hunt3r
Created November 16, 2011 22:46
Show Gist options
  • Save hunt3r/1371742 to your computer and use it in GitHub Desktop.
Save hunt3r/1371742 to your computer and use it in GitHub Desktop.
// handlers
handlersLoggedOut: function() {
var pm = this;
$('.media-item').draggable({
revert: true,
helper: 'clone',
cursor: 'move',
distance: 10,
start: function() {
console.log('do something.');
// show login form above playlist tab
// pm.publisher.trigger("requestDialog", {
// dialogName: "login",
// pointTo: {"target" : $('#site-orion-bar li.playlist'), "direction" : "down"}
// });
}
});
// prevent default click events if playlist has not finished loading
pm.$modules.not('#playlist-module').delegate('.media-item .add a, .media-item a.add-remove, .add-all a, .view-toggle a', 'click', function (event) {
event.preventDefault();
// show login form above playlist tab
pm.publisher.trigger("requestDialog", {
dialogName: "login",
pointTo: {"target" : $('#site-orion-bar li.playlist'), "direction" : "down"}
});
} );
// drag items onto playlist from non-playlist modules
pm.$modules.not('#playlist-module').delegate('.media-item', 'mouseover', function (event) {
if (!$(this).data('media-id')) return;
var $elem = $(this),
mediaId = $elem.data('media-id'),
isGroup = $elem.is('.media-group');
// $elem.draggable({
// revert: true,
// helper: 'clone',
// cursor: 'move',
// distance: 10,
// start: function(event, ui) {
// // show login form above playlist tab
// pm.publisher.trigger("requestDialog", {
// dialogName: "login",
// pointTo: {"target" : $('#site-orion-bar li.playlist'), "direction" : "down"}
// });
// }
// });
} );
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment