mirror of
https://github.com/konvajs/konva.git
synced 2025-09-19 10:47:59 +08:00
added stage getDragLayer() method and unit tests
This commit is contained in:
@@ -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;
|
||||
|
@@ -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');
|
||||
|
||||
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user