mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 01:10:04 +02:00
Better helper bar with float and more room for options
This commit is contained in:
parent
af12fe19f0
commit
17fda94aff
6 changed files with 49 additions and 9 deletions
|
@ -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');
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue