Better helper bar with float and more room for options

This commit is contained in:
Peter Cottle 2013-12-30 10:23:58 -08:00
parent af12fe19f0
commit 17fda94aff
6 changed files with 49 additions and 9 deletions

View file

@ -596,6 +596,10 @@ var LevelToolbar = BaseView.extend({
});
var HelperBar = BaseView.extend({
getClassName: function() {
return 'BaseHelperBar';
},
tagName: 'div',
className: 'helperBar transitionAll',
template: _.template($('#helper-bar-template').html()),
@ -655,6 +659,7 @@ var HelperBar = BaseView.extend({
items: this.getItems()
};
this.render();
this.$el.addClass(this.getClassName());
this.setupChildren();
if (!options.wait) {
@ -664,6 +669,10 @@ var HelperBar = BaseView.extend({
});
var IntlHelperBar = HelperBar.extend({
getClassName: function() {
return 'IntlHelperBar';
},
getItems: function() {
return [{
text: 'Git Branching',
@ -726,10 +735,17 @@ var IntlHelperBar = HelperBar.extend({
});
var CommandsHelperBar = HelperBar.extend({
getClassName: function() {
return 'CommandsHelperBar';
},
getItems: function() {
return [{
text: 'Levels',
id: 'levels'
}, {
text: 'Solution',
id: 'solution'
}, {
text: 'Reset',
id: 'reset'
@ -753,6 +769,10 @@ var CommandsHelperBar = HelperBar.extend({
HelperBar.prototype.fireCommand.apply(this, arguments);
},
onSolutionClick: function() {
this.fireCommand('show solution');
},
onObjectiveClick: function() {
this.fireCommand('objective');
},