diff --git a/packages/joint-core/docs/demo/shapes/shapes.standard.js b/packages/joint-core/docs/demo/shapes/shapes.standard.js index be11d744c..3cf60abd0 100644 --- a/packages/joint-core/docs/demo/shapes/shapes.standard.js +++ b/packages/joint-core/docs/demo/shapes/shapes.standard.js @@ -9,12 +9,11 @@ V.attributeNames['placeholderURL'] = 'placeholderURL'; // Custom attribute for retrieving image placeholder with specific size dia.attributes.placeholderURL = { - qualify: function(url) { - return typeof url === 'string'; - }, set: function(url, refBBox) { + if (typeof url !== 'string') return; return { 'xlink:href': util.template(url)(refBBox.round().toJSON()) }; - } + }, + unset: 'xlink:href' }; var graph = new dia.Graph({}, { cellNamespace: joint.shapes }); diff --git a/packages/joint-core/src/shapes/standard.mjs b/packages/joint-core/src/shapes/standard.mjs index f673373f3..8dc9898f3 100644 --- a/packages/joint-core/src/shapes/standard.mjs +++ b/packages/joint-core/src/shapes/standard.mjs @@ -530,7 +530,8 @@ export const Cylinder = Element.define('standard.Cylinder', { 'Z' ]; return { d: data.join(' ') }; - } + }, + unset: 'd' } } }); @@ -613,6 +614,12 @@ export const TextBlock = Element.define('standard.TextBlock', { return { fill: style.color || null }; } }, + unset: function(node) { + node.textContent = ''; + if (node instanceof SVGElement) { + return 'fill'; + } + }, position: function(text, refBBox, node) { // No foreign object if (node instanceof SVGElement) return refBBox.center();