Created
October 8, 2008 00:36
-
-
Save erichocean/15420 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
require('core'); | |
require('models/message'); | |
OI.messagesController = SC.ArrayController.create({ | |
allowsEmptySelection: false, | |
allowsMultipleSelection: true, | |
contentBinding: 'OI.mailboxController.messages', | |
contentBindingDefault: SC.Binding.Multiple, | |
_isChanging: false, | |
selectionObserver: function() { | |
var sel = this.get('selection'); | |
if (sel && sel.length == 1) { | |
sel[0].markAsRead(); | |
} | |
}.observes('selection'), | |
// Enables dragging to mailboxes | |
collectionViewDragDataTypes: function(view) { | |
return [OI.MESSAGE_TYPE]; | |
}, | |
// Provide the actual message data for dragging | |
collectionViewDragDataForType: function(view, dataType, drag) { | |
return (dataType === OI.MESSAGE_TYPE) ? this.get('selection') : null; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment