Skip to content

Commit 1bb9a31

Browse files
authored
Merge pull request #2035 from bomoko/documentation/DragOverDragLeave
simplified the dragOver and dragLeave examples
2 parents ab20824 + b3a01d6 commit 1bb9a31

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

src/core/p5.Element.js

+6-22
Original file line numberDiff line numberDiff line change
@@ -753,22 +753,14 @@ p5.Element.prototype.touchEnded = function (fxn) {
753753
* textAlign(CENTER);
754754
* text('Drag file', width/2, height/2);
755755
* c.dragOver(dragOverCallback);
756-
* c.dragLeave(dragLeaveCallback);
757756
* }
758-
*
757+
*
759758
* // This function will be called whenever
760759
* // a file is dragged over the canvas
761760
* function dragOverCallback() {
762761
* background(240);
763762
* text('Dragged over', width/2, height/2);
764763
* }
765-
*
766-
* // This function will be called whenever
767-
* // a file is dragged out of the canvas
768-
* function dragLeaveCallback() {
769-
* background(200);
770-
* text('Dragged off', width/2, height/2);
771-
* }
772764
* </code></div>
773765
* @alt
774766
* nothing displayed
@@ -789,28 +781,20 @@ p5.Element.prototype.dragOver = function (fxn) {
789781
* @return {p5.Element}
790782
* @example
791783
* <div><code>
792-
* // To test this sketch, simply drag a
793-
* // file over the canvas
784+
* // To test this sketch, simply drag a file
785+
* // over and then out of the canvas area
794786
* function setup() {
795787
* var c = createCanvas(100, 100);
796788
* background(200);
797789
* textAlign(CENTER);
798790
* text('Drag file', width/2, height/2);
799-
* c.dragOver(dragOverCallback);
800791
* c.dragLeave(dragLeaveCallback);
801792
* }
802-
*
803-
* // This function will be called whenever
804-
* // a file is dragged over the canvas
805-
* function dragOverCallback() {
806-
* background(240);
807-
* text('Dragged over', width/2, height/2);
808-
* }
809-
*
793+
*
810794
* // This function will be called whenever
811-
* // a file is dragged out of the canvas
795+
* // a file is dragged out of the canvas
812796
* function dragLeaveCallback() {
813-
* background(200);
797+
* background(240);
814798
* text('Dragged off', width/2, height/2);
815799
* }
816800
* </code></div>

0 commit comments

Comments
 (0)