Created
November 16, 2011 22:46
-
-
Save hunt3r/1371742 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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