Skip to content

Instantly share code, notes, and snippets.

@enyo
Created Mar 7, 2010
Embed
What would you like to do?
// ==========================================================================
// Project: Dragtest - mainPage
// Copyright: ©2010 Matthias Loitsch
// ==========================================================================
/*globals Dragtest */
// This page describes the main user interface for your application.
Dragtest.button = SC.ButtonView.extend({
isEnabled: NO,
title: 'test',
mouseDown: function(evt) {
// initiate the drag
SC.Drag.start({
event: evt,
source: this,
dragView: this,
ghost: YES,
slideBack: YES,
dataSource: this
}) ;
return YES ;
},
dragSourceOperationMaskFor: function(drag, dropTarget) {
return SC.DRAG_ANY ;
}
});
Dragtest.mainPage = SC.Page.design({
pageName: 'Dragtest.mainPage',
mainPane: SC.MainPane.design({
childViews: [
Dragtest.button.design( { layout: { top: 0, left: 0, width: 200, height: 100 }} ),
Dragtest.button.design( { layout: { top: 50, left: 50, width: 200, height: 100 } } )
]
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment