level toolbar thing

This commit is contained in:
Peter Cottle 2013-01-05 13:22:14 -08:00
parent 6ee05c1f0a
commit 5d981a1268
5 changed files with 132 additions and 4 deletions

View file

@ -331,7 +331,6 @@ var CommandLineHistoryView = Backbone.View.extend({
var toDestroy = [];
this.collection.each(function(command) {
console.log('this command', command, command.get('status'));
if (command.get('status') !== 'inqueue' &&
command.get('status') !== 'processing') {
toDestroy.push(command);

View file

@ -341,6 +341,42 @@ var ZoomAlertWindow = Backbone.View.extend({
}
});
var LevelToolbar = BaseView.extend({
tagName: 'div',
template: _.template($('#level-toolbar-template').html()),
initialize: function(options) {
options = options || {};
this.JSON = {
levelName: options.levelName || 'Some level! (unknown name)'
};
this.beforeDestination = $($('#commandLineHistory div.toolbar')[0]);
this.render();
if (!options.wait) {
process.nextTick(_.bind(function() {
this.show();
}, this));
}
},
render: function() {
var HTML = this.template(this.JSON);
this.$el.html(HTML);
this.beforeDestination.after(this.el);
},
hide: function() {
this.$('div.toolbar').toggleClass('hidden', true);
},
show: function() {
this.$('div.toolbar').toggleClass('hidden', false);
}
});
var CanvasTerminalHolder = BaseView.extend({
tagName: 'div',
className: 'canvasTerminalHolder box flex1',
@ -393,4 +429,5 @@ exports.ZoomAlertWindow = ZoomAlertWindow;
exports.ConfirmCancelTerminal = ConfirmCancelTerminal;
exports.CanvasTerminalHolder = CanvasTerminalHolder;
exports.LevelToolbar = LevelToolbar;