Skip to content

Instantly share code, notes, and snippets.

@joshholt
Created August 5, 2009 04:29
Show Gist options
  • Save joshholt/162503 to your computer and use it in GitHub Desktop.
Save joshholt/162503 to your computer and use it in GitHub Desktop.
collectionViewDragViewFor: function(view, dragContent) {
// TODO [JH2] Make this an imageView
var content = view.getPath('selection.firstObject');
var size = content.get('naturalSize');
var dragLayer = view.get('layer').cloneNode(false);
return SC.View.design({
parentView: view,
layer: dragLayer,
layout: { top: 0, left: 0, height: size.height, width: size.width },
childViews: [
SC.LabelView.design({
layout: { top: 0, left: 0, height: 50, width: 150},
value: "Test DragView"
})
]
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment