added stage getDragLayer() method and unit tests

This commit is contained in:
Eric Rowell
2013-01-12 23:45:28 -08:00
parent 5cda46be69
commit f5f2fbaba9
2 changed files with 17 additions and 0 deletions

View File

@@ -326,6 +326,12 @@
// chainable
return this;
},
/**
* get drag and drop layer
*/
getDragLayer: function() {
return this.dragLayer;
},
_setUserPosition: function(evt) {
if(!evt) {
evt = window.event;

View File

@@ -259,5 +259,16 @@ Test.Modules.STAGE = {
test(stage.getStage() !== undefined, 'stage is undefined');
//console.log(stage.getStage());
},
'test stage.getDragLayer': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,
width: 578,
height: 200
});
test(stage.getDragLayer().getCanvas().getElement().className === 'kinetic-drag-and-drop-layer', 'problem with stage.getDragLayer');
}
};