##// END OF EJS Templates
add doc to base Cell
Matthias BUSSONNIER -
Show More
@@ -52,9 +52,9 var IPython = (function (IPython) {
52
52
53
53
54 /**
54 /**
55 * Empty. Subclasses must implement create_element.
55 * Subclasses can implement override bind_events.
56 * This should contain all the code to create the DOM element in notebook
56 * Be carefull to call the parent method when overwriting as it fires event.
57 * and will be called by Base Class constructor.
57 * this will be triggerd after create_element in constructor.
58 * @method bind_events
58 * @method bind_events
59 */
59 */
60 Cell.prototype.bind_events = function () {
60 Cell.prototype.bind_events = function () {
@@ -72,6 +72,10 var IPython = (function (IPython) {
72 });
72 });
73 };
73 };
74
74
75 /**
76 * Triger typsetting of math by mathjax on current cell element
77 * @method typeset
78 */
75 Cell.prototype.typeset = function () {
79 Cell.prototype.typeset = function () {
76 if (window.MathJax){
80 if (window.MathJax){
77 var cell_math = this.element.get(0);
81 var cell_math = this.element.get(0);
@@ -79,12 +83,20 var IPython = (function (IPython) {
79 }
83 }
80 };
84 };
81
85
86 /**
87 * should be triggerd when cell is selected
88 * @method select
89 */
82 Cell.prototype.select = function () {
90 Cell.prototype.select = function () {
83 this.element.addClass('ui-widget-content ui-corner-all');
91 this.element.addClass('ui-widget-content ui-corner-all');
84 this.selected = true;
92 this.selected = true;
85 };
93 };
86
94
87
95
96 /**
97 * should be triggerd when cell is unselected
98 * @method unselect
99 */
88 Cell.prototype.unselect = function () {
100 Cell.prototype.unselect = function () {
89 this.element.removeClass('ui-widget-content ui-corner-all');
101 this.element.removeClass('ui-widget-content ui-corner-all');
90 this.selected = false;
102 this.selected = false;
@@ -23,6 +23,7 var IPython = (function (IPython) {
23 *
23 *
24 * @class TextCell
24 * @class TextCell
25 * @constructor TextCell
25 * @constructor TextCell
26 * @extend Cell
26 */
27 */
27 var TextCell = function () {
28 var TextCell = function () {
28 this.code_mirror_mode = this.code_mirror_mode || 'htmlmixed';
29 this.code_mirror_mode = this.code_mirror_mode || 'htmlmixed';
General Comments 0
You need to be logged in to leave comments. Login now