angular-draganddrop
Advanced tools
Comparing version
@@ -49,2 +49,4 @@ /*! Angular draganddrop v0.1.4 | (c) 2013 Greg Bergé | License MIT */ | ||
e.dataTransfer.setData('json/' + draggableType, jsonData); | ||
e.stopPropagation(); | ||
}); | ||
@@ -51,0 +53,0 @@ } |
{ | ||
"name": "angular-draganddrop", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/neoziro/angular-draganddrop", | ||
@@ -5,0 +5,0 @@ "authors": [ |
{ | ||
"name": "angular-draganddrop", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"description": "Drag and drop directives for Angular using native HTML5 API.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,3 @@ var expect = chai.expect; | ||
dragEvent = document.createEvent('CustomEvent'); | ||
dragEvent.initCustomEvent('dragstart', false, false, false); | ||
dragEvent.initCustomEvent('dragstart', true, false, false); | ||
dragEvent.dataTransfer = { | ||
@@ -50,3 +50,15 @@ setData: sinon.spy() | ||
}); | ||
it('should prevent bubbling', function() { | ||
var tpl = '<div draggable draggable-data="{foo: \'bar\'}" draggable-type="image">'+ | ||
'<div class="sub" draggable draggable-data="{toto: \'toto\'}" draggable-type="toto"></div>'+ | ||
'</div>'; | ||
var element = $compile(tpl)(scope); | ||
// Bubbling can only be test on firefox, due to a chrome bug where customEvent don't bubble | ||
startDrag(element.find('.sub')); | ||
expect(dragEvent.dataTransfer.setData).to.have.been.calledOnce; | ||
}); | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
26304
2.2%469
2.4%