return elements instead of append them directly

+ jshint fixes
pull/37/head
Bussonnier Matthias 11 years ago
parent 8fc6d2ff1f
commit cd67e1aca7

@ -6,7 +6,7 @@ define([
'base/js/namespace',
'jquery',
'./toolbar',
'./celltoolbar',
'./celltoolbar'
], function(require, IPython, $, toolbar, celltoolbar) {
"use strict";
@ -52,11 +52,11 @@ define([
'move_up_down'],
[ ['ipython.run-select-next',
'ipython.interrupt-kernel',
'ipython.restart-kernel',
'ipython.restart-kernel'
],
'run_int'],
['<add_celltype_list>'],
['<add_celltoolbar_list>'],
['<add_celltoolbar_list>']
];
this.construct(grps);
};
@ -95,13 +95,13 @@ define([
case 'heading':
that.notebook._warn_heading();
that.notebook.to_heading();
sel.val('markdown')
sel.val('markdown');
break;
default:
console.log("unrecognized cell type:", cell_type);
}
});
this.element.append(sel);
return sel;
};
@ -111,7 +111,6 @@ define([
.attr('id', 'ctb_select')
.addClass('form-control select-xs')
.append($('<option/>').attr('value', '').text('None'));
this.element.append(label).append(select);
var that = this;
select.change(function() {
var val = $(this).val();
@ -140,6 +139,10 @@ define([
if (select.val() !== data.name)
select.val(data.name);
});
var wrapper = $('<div/>').addClass('btn-group');
wrapper.append(label).append(select);
return wrapper;
};
// Backwards compatibility.

@ -95,7 +95,7 @@ define([
var _pseudo_action;
try{
_pseudo_action = list.slice(1,-1);
this._pseudo_actions[_pseudo_action].call(this);
this.element.append(this._pseudo_actions[_pseudo_action].call(this));
} catch (e) {
console.warn('ouch, calling ', _pseudo_action, 'does not seem to work...:', e);
}

Loading…
Cancel
Save