abcjs 6.1.4 → 6.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abcjs",
3
- "version": "6.1.4",
3
+ "version": "6.1.6",
4
4
  "description": "Renderer for abc music notation",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -32,7 +32,7 @@ function getCoord(ev) {
32
32
 
33
33
  // when renderer.options.responsive === 'resize' the click coords are in relation to the HTML
34
34
  // element, we need to convert to the SVG viewBox coords
35
- if (svg.viewBox.baseVal) { // Firefox passes null to this when no viewBox is given
35
+ if (svg && svg.viewBox && svg.viewBox.baseVal) { // Firefox passes null to this when no viewBox is given
36
36
  // Chrome makes these values null when no viewBox is given.
37
37
  if (svg.viewBox.baseVal.width !== 0)
38
38
  scaleX = svg.viewBox.baseVal.width / svg.clientWidth
@@ -200,11 +200,15 @@ function getTarget(target) {
200
200
 
201
201
  var found = target.getAttribute("selectable");
202
202
  while (!found) {
203
- target = target.parentElement;
204
- if (target.tagName === "svg")
203
+ if (!target.parentElement)
205
204
  found = true;
206
- else
207
- found = target.getAttribute("selectable");
205
+ else {
206
+ target = target.parentElement;
207
+ if (target.tagName === "svg")
208
+ found = true;
209
+ else
210
+ found = target.getAttribute("selectable");
211
+ }
208
212
  }
209
213
  return target;
210
214
  }
@@ -298,7 +302,7 @@ function mouseUp(ev) {
298
302
  var _ev = ev;
299
303
  if (ev.type === 'touchend' && this.lastTouchMove) {
300
304
  attachMissingTouchEventAttributes(this.lastTouchMove);
301
- if (ev.touches.length > 0)
305
+ if (this.lastTouchMove && this.lastTouchMove.touches && this.lastTouchMove.touches.length > 0)
302
306
  _ev = this.lastTouchMove.touches[0];
303
307
  }
304
308
 
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
- var version = '6.1.4';
1
+ var version = '6.1.6';
2
2
 
3
3
  module.exports = version;