fnp
/
fnpeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
editor: removing span on delete with only one character
[fnpeditor.git]
/
src
/
editor
/
plugins
/
core
/
canvasElements.js
diff --git
a/src/editor/plugins/core/canvasElements.js
b/src/editor/plugins/core/canvasElements.js
index
37eefb8
..
0d7cffa
100644
(file)
--- a/
src/editor/plugins/core/canvasElements.js
+++ b/
src/editor/plugins/core/canvasElements.js
@@
-2,6
+2,9
@@
define(function(require) {
'use strict';
'use strict';
+var $ = require('libs/jquery'),
+ genericElement = require('modules/documentCanvas/canvas/genericElement'), // TODO: This should be accessible via plugin infrastructure
+ linkElement = require('./links/linkElement');
var widgets = {
footnoteHandler: function(clickHandler) {
var widgets = {
footnoteHandler: function(clickHandler) {
@@
-49,12
+52,13
@@
var widgets = {
});
return mydom;
}
});
return mydom;
}
-}
+}
;
-var comment = {
+var comment = Object.create(genericElement);
+$.extend(comment, {
init: function() {
init: function() {
-
this.super
.init.call(this);
+
genericElement
.init.call(this);
this.commentAdnotation = widgets.commentAdnotation(this.wlxmlNode);
this.addWidget(this.commentAdnotation, 'show');
this.commentAdnotation.DOM.show();
this.commentAdnotation = widgets.commentAdnotation(this.wlxmlNode);
this.addWidget(this.commentAdnotation, 'show');
this.commentAdnotation.DOM.show();
@@
-69,11
+73,12
@@
var comment = {
onMetadataRemoved: function(event) {
return this.onMetadataChanged(event);
}
onMetadataRemoved: function(event) {
return this.onMetadataChanged(event);
}
-};
+}
)
;
-var footnote = {
+var footnote = Object.create(genericElement);
+$.extend(footnote, {
init: function() {
init: function() {
-
this.super
.init.call(this);
+
genericElement
.init.call(this);
var clickHandler = function() {
this.toggle(true);
}.bind(this);
var clickHandler = function() {
this.toggle(true);
}.bind(this);
@@
-99,15
+104,16
@@
var footnote = {
}
this._container().toggle(toggle);
if(!options.silent) {
}
this._container().toggle(toggle);
if(!options.silent) {
- this.trigger('elementToggled', toggle, this
.documentElement
);
+ this.trigger('elementToggled', toggle, this);
}
}
}
}
-}
+}
);
return [
return [
- {klass: 'comment', element: comment},
- {klass: 'footnote', element: footnote}
+ {tag: 'aside', klass: 'comment', prototype: null},
+ {tag: 'aside', klass: 'footnote', prototype: footnote},
+ {tag: 'span', klass: 'link', prototype: linkElement}
];
];