Browse Source

Add setCustomBadgeLabel method to canvas

pull/187/head
Artur Arseniev 9 years ago
parent
commit
ca102a5bbb
  1. 20
      src/canvas/index.js

20
src/canvas/index.js

@ -54,6 +54,14 @@ module.exports = () => {
return this;
},
/**
* Return config object
* @return {Object}
*/
getConfig() {
return c;
},
/**
* Add wrapper
* @param {Object} wrp Wrapper
@ -203,6 +211,18 @@ module.exports = () => {
};
},
/**
* Set custom badge naming strategy
* @param {Function} f
* @example
* canvas.setCustomBadgeLabel(function(model){
* return ComponentModel.getName();
* });
*/
setCustomBadgeLabel(f) {
c.customBadgeLabel = f;
},
/**
* Get element position relative to the canvas
* @param {HTMLElement} el

Loading…
Cancel
Save