X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/0bea7025f60aa5cc2ed89eed72da0d616f3574ef..66beb53d8311c422fe21637493136780002d0fc5:/src/editor/plugins/core/canvasElements.js diff --git a/src/editor/plugins/core/canvasElements.js b/src/editor/plugins/core/canvasElements.js index 37eefb8..addaeae 100644 --- a/src/editor/plugins/core/canvasElements.js +++ b/src/editor/plugins/core/canvasElements.js @@ -1,6 +1,8 @@ define(function(require) { 'use strict'; +var $ = require('libs/jquery'), + genericElement = require('modules/documentCanvas/canvas/genericElement'); // TODO: This should be accessible via plugin infrastructure var widgets = { @@ -49,12 +51,13 @@ var widgets = { }); return mydom; } -} +}; -var comment = { +var comment = Object.create(genericElement); +$.extend(comment, { 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(); @@ -69,11 +72,12 @@ var comment = { onMetadataRemoved: function(event) { return this.onMetadataChanged(event); } -}; +}); -var footnote = { +var footnote = Object.create(genericElement); +$.extend(footnote, { init: function() { - this.super.init.call(this); + genericElement.init.call(this); var clickHandler = function() { this.toggle(true); }.bind(this); @@ -99,15 +103,15 @@ var footnote = { } this._container().toggle(toggle); if(!options.silent) { - this.trigger('elementToggled', toggle, this.documentElement); + this.trigger('elementToggled', toggle, this); } } -} +}); return [ - {klass: 'comment', element: comment}, - {klass: 'footnote', element: footnote} + {tag: 'aside', klass: 'comment', prototype: comment}, + {tag: 'aside', klass: 'footnote', prototype: footnote} ];