footnote wip: expanding/collapsing footnotes
[fnpeditor.git] / modules / documentCanvas / canvas / widgets.js
1 define([
2 'libs/jquery-1.9.1.min'
3 ], function($) {
4     
5 'use strict';
6
7 return {
8     labelWidget: function(tag, klass) {
9         return $('<span>')
10             .addClass('canvas-widget canvas-widget-label')
11             .text(tag + (klass ? ' / ' + klass : ''));
12     },
13
14     footnoteHandler: function(clickHandler) {
15         var mydom = $('<span>')
16             .addClass('canvas-widget canvas-widget-footnote-handle')
17             .css('display', 'inline')
18             .show();
19
20         mydom.click(function() {
21             clickHandler();
22         });
23
24         return mydom;
25     },
26
27     hideButton: function(clickHandler) {
28         var mydom = $('<span>x</span>')
29             .addClass('canvas-widget canvas-widget-hide-button');
30         mydom.click(clickHandler);
31         return mydom;
32     }
33
34 };
35
36 });