smartxml: Fixing single text node unwrap
[fnpeditor.git] / src / editor / modules / documentCanvas / canvas / widgets.js
1 define([
2 'libs/jquery',
3 'utils/wlxml'
4 ], function($, wlxmlUtils) {
5     
6 'use strict';
7
8 return {
9     labelWidget: function(tag, klass) {
10         return $('<span>')
11             .addClass('canvas-widget canvas-widget-label')
12             .text(wlxmlUtils.wlxmlTagNames[tag] + (klass ? ' / ' + wlxmlUtils.wlxmlClassNames[klass] : ''));
13     },
14
15     footnoteHandler: function(clickHandler) {
16         var mydom = $('<span>')
17             .addClass('canvas-widget canvas-widget-footnote-handle')
18             .css('display', 'inline')
19             .show();
20
21         mydom.click(function(e) {
22             e.stopPropagation();
23             clickHandler();
24         });
25
26         return mydom;
27     },
28
29     hideButton: function(clickHandler) {
30         var mydom = $('<span>x</span>')
31             .addClass('canvas-widget canvas-widget-hide-button');
32         mydom.click(function(e) {
33             e.stopPropagation();
34             clickHandler();
35         });
36         return mydom;
37     }
38
39 };
40
41 });