diagram-js
Advanced tools
Comparing version 11.5.0 to 11.6.0
@@ -1,2 +0,2 @@ | ||
import { forEach } from 'min-dash'; | ||
import { forEach, isDefined } from 'min-dash'; | ||
@@ -28,18 +28,18 @@ /** | ||
if (alignment.left) { | ||
if (isDefined(alignment.left)) { | ||
delta.x = alignment.left - element.x; | ||
} else if (alignment.right) { | ||
} else if (isDefined(alignment.right)) { | ||
delta.x = (alignment.right - element.width) - element.x; | ||
} else if (alignment.center) { | ||
} else if (isDefined(alignment.center)) { | ||
delta.x = (alignment.center - Math.round(element.width / 2)) - element.x; | ||
} else if (alignment.top) { | ||
} else if (isDefined(alignment.top)) { | ||
delta.y = alignment.top - element.y; | ||
} else if (alignment.bottom) { | ||
} else if (isDefined(alignment.bottom)) { | ||
delta.y = (alignment.bottom - element.height) - element.y; | ||
} else if (alignment.middle) { | ||
} else if (isDefined(alignment.middle)) { | ||
delta.y = (alignment.middle - Math.round(element.height / 2)) - element.y; | ||
@@ -46,0 +46,0 @@ } |
@@ -288,5 +288,3 @@ import { | ||
Palette.prototype.trigger = function(action, event, autoActivate) { | ||
var entries = this._entries, | ||
entry, | ||
handler, | ||
var entry, | ||
originalEvent, | ||
@@ -299,4 +297,15 @@ button = event.delegateTarget || event.target; | ||
entry = entries[domAttr(button, 'data-action')]; | ||
entry = domAttr(button, 'data-action'); | ||
originalEvent = event.originalEvent || event; | ||
return this.triggerEntry(entry, action, originalEvent, autoActivate); | ||
}; | ||
Palette.prototype.triggerEntry = function(entryId, action, event, autoActivate) { | ||
var entries = this._entries, | ||
entry, | ||
handler; | ||
entry = entries[entryId]; | ||
// when user clicks on the palette and not on an action | ||
@@ -309,12 +318,10 @@ if (!entry) { | ||
originalEvent = event.originalEvent || event; | ||
// simple action (via callback function) | ||
if (isFunction(handler)) { | ||
if (action === 'click') { | ||
handler(originalEvent, autoActivate); | ||
return handler(event, autoActivate); | ||
} | ||
} else { | ||
if (handler[action]) { | ||
handler[action](originalEvent, autoActivate); | ||
return handler[action](event, autoActivate); | ||
} | ||
@@ -321,0 +328,0 @@ } |
@@ -206,3 +206,3 @@ import { | ||
${ entry.imageUrl ? html` | ||
<img class="djs-popup-entry-icon" src=${ entry.imageUrl } /> | ||
<img class="djs-popup-entry-icon" src=${ entry.imageUrl } alt="" /> | ||
` : null } | ||
@@ -209,0 +209,0 @@ |
@@ -43,3 +43,3 @@ import classNames from 'clsx'; | ||
${ entry.imageUrl ? html` | ||
<img class="djs-popup-entry-icon" src=${ entry.imageUrl } /> | ||
<img class="djs-popup-entry-icon" src=${ entry.imageUrl } alt="" /> | ||
` : null } | ||
@@ -46,0 +46,0 @@ |
{ | ||
"name": "diagram-js", | ||
"version": "11.5.0", | ||
"version": "11.6.0", | ||
"description": "A toolbox for displaying and modifying diagrams on the web", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
673814
23000