Created
March 7, 2010 18:01
-
-
Save enyo/324510 to your computer and use it in GitHub Desktop.
This file contains 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
// ========================================================================== | |
// 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