fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
metaWidget wip: reacting to class change
[fnpeditor.git]
/
modules
/
documentCanvas
/
canvasNode.js
diff --git
a/modules/documentCanvas/canvasNode.js
b/modules/documentCanvas/canvasNode.js
index
a57c10a
..
1ef5628
100644
(file)
--- a/
modules/documentCanvas/canvasNode.js
+++ b/
modules/documentCanvas/canvasNode.js
@@
-38,6
+38,16
@@
CanvasNode.prototype.getClass = function() {
return this.dom.attr('wlxml-class');
};
return this.dom.attr('wlxml-class');
};
+CanvasNode.prototype.setClass = function(klass) {
+ if(klass != this.getClass()) {
+ this.dom.attr('wlxml-class', klass);
+ var c = this;
+ this.getMetaAttrs().forEach(function(attr) {
+ c.dom.removeAttr('wlxml-meta-' + attr.name);
+ });
+ }
+}
+
CanvasNode.prototype.getId = function() {
return this.dom.attr('id');
};
CanvasNode.prototype.getId = function() {
return this.dom.attr('id');
};