##// END OF EJS Templates
Fixing css class on cell related to selected, rendered, mode.
Brian E. Granger -
Show More
@@ -62,6 +62,7 b' var IPython = (function (IPython) {'
62 if (this.element !== null) {
62 if (this.element !== null) {
63 this.element.data("cell", this);
63 this.element.data("cell", this);
64 this.bind_events();
64 this.bind_events();
65 this.init_classes();
65 }
66 }
66 };
67 };
67
68
@@ -99,6 +100,26 b' var IPython = (function (IPython) {'
99 Cell.prototype.create_element = function () {
100 Cell.prototype.create_element = function () {
100 };
101 };
101
102
103 Cell.prototype.init_classes = function () {
104 // Call after this.element exists to initialize the css classes
105 // related to selected, rendered and mode.
106 if (this.selected) {
107 this.element.addClass('selected');
108 } else {
109 this.element.addClass('unselected');
110 }
111 if (this.rendered) {
112 this.element.addClass('rendered');
113 } else {
114 this.element.addClass('unrendered');
115 }
116 if (this.mode === 'edit') {
117 this.element.addClass('edit_mode');
118 } else {
119 this.element.addClass('command_mode');
120 }
121 }
122
102
123
103 /**
124 /**
104 * Subclasses can implement override bind_events.
125 * Subclasses can implement override bind_events.
General Comments 0
You need to be logged in to leave comments. Login now