Flat, round, designer-friendly pseudo-3D engine for canvas & SVG
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿ›  Dragger.getQueryElement

+12 -6
+11 -2
js/dragger.js
··· 51 51 }; 52 52 53 53 Dragger.prototype.bindDrag = function( element ) { 54 + element = this.getQueryElement( element ); 54 55 if ( element ) { 55 56 element.addEventListener( downEvent , this ); 56 57 } 58 + }; 59 + 60 + Dragger.prototype.getQueryElement = function( element ) { 61 + if ( typeof element == 'string' ) { 62 + // with string, query selector 63 + element = document.querySelector( element ); 64 + } 65 + return element; 57 66 }; 58 67 59 68 Dragger.prototype.handleEvent = function( event ) { ··· 101 110 Dragger.prototype.onmouseup = 102 111 Dragger.prototype.onpointerup = 103 112 Dragger.prototype.ontouchend = 104 - Dragger.prototype.dragEnd = function( event ) { 113 + Dragger.prototype.dragEnd = function(/* event */) { 105 114 window.removeEventListener( moveEvent, this ); 106 115 window.removeEventListener( upEvent, this ); 107 - this.onDragEnd( event ); 116 + this.onDragEnd(); 108 117 }; 109 118 110 119 return Dragger;
+1 -4
js/illustration.js
··· 46 46 }; 47 47 48 48 Illustration.prototype.setElement = function( element ) { 49 - if ( typeof element == 'string' ) { 50 - // with string, query selector 51 - element = document.querySelector( element ); 52 - } 49 + element = this.getQueryElement( element ); 53 50 if ( !element ) { 54 51 throw new Error( 'Zdog.Illustration element required. Set to ' + element ); 55 52 }