fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
editor: links - proper linking to document attachments
[fnpeditor.git]
/
src
/
editor
/
modules
/
documentCanvas
/
canvas
/
documentElement.js
diff --git
a/src/editor/modules/documentCanvas/canvas/documentElement.js
b/src/editor/modules/documentCanvas/canvas/documentElement.js
index
277d70a
..
7acf7c8
100644
(file)
--- a/
src/editor/modules/documentCanvas/canvas/documentElement.js
+++ b/
src/editor/modules/documentCanvas/canvas/documentElement.js
@@
-81,6
+81,7
@@
DocumentNodeElement.prototype = Object.create(DocumentElement.prototype);
$.extend(DocumentNodeElement.prototype, {
defaultDisplayStyle: 'block',
$.extend(DocumentNodeElement.prototype, {
defaultDisplayStyle: 'block',
+ init: function() {},
addWidget: function(widget) {
this.dom.children('.canvas-widgets').append(widget.DOM ? widget.DOM : widget);
},
addWidget: function(widget) {
this.dom.children('.canvas-widgets').append(widget.DOM ? widget.DOM : widget);
},
@@
-132,6
+133,8
@@
$.extend(DocumentNodeElement.prototype, {
this.toggleHighlight(toggle);
},
this.toggleHighlight(toggle);
},
+ markAsCurrent: function() {},
+
toggleHighlight: function(toggle) {
this._container().toggleClass('highlighted-element', toggle);
},
toggleHighlight: function(toggle) {
this._container().toggleClass('highlighted-element', toggle);
},
@@
-189,7
+192,12
@@
$.extend(DocumentTextElement.prototype, {
return this;
},
setText: function(text) {
return this;
},
setText: function(text) {
- this.dom.contents()[0].data = text;
+ if(text === '') {
+ text = utils.unicode.ZWS;
+ }
+ if(text !== this.getText()) {
+ this.dom.contents()[0].data = text;
+ }
},
getText: function(options) {
options = _.extend({raw: false}, options || {});
},
getText: function(options) {
options = _.extend({raw: false}, options || {});