##// END OF EJS Templates
change set_preset to activate_preset...
Matthias BUSSONNIER -
Show More
@@ -46,7 +46,7 b' var IPython = (function (IPython) {'
46 46 $('body').removeClass('celltoolbar-on')
47 47 } else {
48 48 $('body').addClass('celltoolbar-on')
49 CellToolbar.set_preset(val)
49 CellToolbar.activate_preset(val)
50 50 }
51 51 })
52 52
@@ -57,6 +57,8 b' var IPython = (function (IPython) {'
57 57 * we need to think of wether or not we allow nested namespace
58 58 * @property _callback_dict
59 59 * @private
60 * @static
61 * @type Dict
60 62 */
61 63 CellToolbar._callback_dict = {};
62 64
@@ -65,17 +67,19 b' var IPython = (function (IPython) {'
65 67 * to add to the toolbar of each cell
66 68 * @property _ui_controls_list
67 69 * @private
70 * @static
71 * @type List
68 72 */
69 73 CellToolbar._ui_controls_list = [];
70 74
71 75 /**
72 * keep a list of all instances to
73 * be able to llop over them...
74 * but how to 'destroy' them ?
75 * have to think about it...
76 * or loop over the cells, and find their CellToolbar instances.
76 * Class variable that should contains the CellToolbar instances for each
77 * cell of the notebook
78 *
77 79 * @private
78 80 * @property _instances
81 * @static
82 * @type List
79 83 */
80 84 CellToolbar._instances =[]
81 85
@@ -83,6 +87,8 b' var IPython = (function (IPython) {'
83 87 * keep a list of all the availlabel presets for the toolbar
84 88 * @private
85 89 * @property _presets
90 * @static
91 * @type Dict
86 92 */
87 93 CellToolbar._presets ={}
88 94
@@ -98,7 +104,7 b' var IPython = (function (IPython) {'
98 104 * The callback will receive the following element :
99 105 *
100 106 * * a div in which to add element.
101 * * the cell it is responsable from
107 * * the cell it is responsible from
102 108 *
103 109 * @example
104 110 *
@@ -129,7 +135,7 b' var IPython = (function (IPython) {'
129 135 * CellToolbar.register_callback('foo', toggle);
130 136 */
131 137 CellToolbar.register_callback = function(name, callback){
132 // what do we do if name already exist ?
138 // Overwrite if it already exists.
133 139 CellToolbar._callback_dict[name] = callback;
134 140 };
135 141
@@ -161,17 +167,20 b' var IPython = (function (IPython) {'
161 167 )
162 168 }
163 169 /**
164 * set an UI preset from `register_preset`
165 * @method set_preset
170 * Activate an UI preset from `register_preset`
171 *
172 * This does not update the selection UI.
173 *
174 * @method activate_preset
166 175 * @param preset_name {String} string corresponding to the preset name
167 176 *
168 177 * @static
169 178 * @private
170 179 * @example
171 180 *
172 * CellToolbar.set_preset('foo.foo_preset1');
181 * CellToolbar.activate_preset('foo.foo_preset1');
173 182 */
174 CellToolbar.set_preset= function(preset_name){
183 CellToolbar.activate_preset= function(preset_name){
175 184 var preset = CellToolbar._presets[preset_name];
176 185
177 186 if(preset != undefined){
General Comments 0
You need to be logged in to leave comments. Login now