Skip to content

Instantly share code, notes, and snippets.

@enyo
Created March 7, 2010 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enyo/324510 to your computer and use it in GitHub Desktop.
Save enyo/324510 to your computer and use it in GitHub Desktop.
// ==========================================================================
// 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