mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 09:20:03 +02:00
better highlighting with keyboard events for level dropdown view
This commit is contained in:
parent
9e24c2dfa2
commit
33e5060ac7
5 changed files with 40 additions and 3 deletions
|
@ -23159,6 +23159,15 @@ var LevelDropdownView = ContainedBase.extend({
|
|||
this.selectedID = id;
|
||||
var selector = '#levelIcon-' + id;
|
||||
$(selector).toggleClass('selected', value);
|
||||
|
||||
// also go find the series and update the about
|
||||
_.each(this.seriesViews, function(view) {
|
||||
if (view.levelIDs.indexOf(id) === -1) {
|
||||
view.resetAbout();
|
||||
return;
|
||||
}
|
||||
view.updateAboutForLevelID(id);
|
||||
}, this);
|
||||
},
|
||||
|
||||
negative: function() {
|
||||
|
@ -23280,6 +23289,10 @@ var SeriesView = BaseView.extend({
|
|||
|
||||
enterIcon: function(ev) {
|
||||
var id = this.getEventID(ev);
|
||||
this.updateAboutForLevelID(id);
|
||||
},
|
||||
|
||||
updateAboutForLevelID: function(id) {
|
||||
var level = Main.getLevelArbiter().getLevel(id);
|
||||
this.setAbout(intl.getName(level));
|
||||
},
|
||||
|
@ -34530,6 +34543,15 @@ var LevelDropdownView = ContainedBase.extend({
|
|||
this.selectedID = id;
|
||||
var selector = '#levelIcon-' + id;
|
||||
$(selector).toggleClass('selected', value);
|
||||
|
||||
// also go find the series and update the about
|
||||
_.each(this.seriesViews, function(view) {
|
||||
if (view.levelIDs.indexOf(id) === -1) {
|
||||
view.resetAbout();
|
||||
return;
|
||||
}
|
||||
view.updateAboutForLevelID(id);
|
||||
}, this);
|
||||
},
|
||||
|
||||
negative: function() {
|
||||
|
@ -34651,6 +34673,10 @@ var SeriesView = BaseView.extend({
|
|||
|
||||
enterIcon: function(ev) {
|
||||
var id = this.getEventID(ev);
|
||||
this.updateAboutForLevelID(id);
|
||||
},
|
||||
|
||||
updateAboutForLevelID: function(id) {
|
||||
var level = Main.getLevelArbiter().getLevel(id);
|
||||
this.setAbout(intl.getName(level));
|
||||
},
|
||||
|
|
File diff suppressed because one or more lines are too long
1
build/bundle.min.js
vendored
1
build/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -445,7 +445,7 @@
|
|||
For a much easier time perusing the source, see the individual files at:
|
||||
https://github.com/pcottle/learnGitBranching
|
||||
-->
|
||||
<script src="build/bundle.min.21204f7a.js"></script>
|
||||
<script src="build/bundle.js"></script>
|
||||
|
||||
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
||||
The downside? No raw logs to parse for analytics, so I have to include
|
||||
|
|
|
@ -194,6 +194,15 @@ var LevelDropdownView = ContainedBase.extend({
|
|||
this.selectedID = id;
|
||||
var selector = '#levelIcon-' + id;
|
||||
$(selector).toggleClass('selected', value);
|
||||
|
||||
// also go find the series and update the about
|
||||
_.each(this.seriesViews, function(view) {
|
||||
if (view.levelIDs.indexOf(id) === -1) {
|
||||
view.resetAbout();
|
||||
return;
|
||||
}
|
||||
view.updateAboutForLevelID(id);
|
||||
}, this);
|
||||
},
|
||||
|
||||
negative: function() {
|
||||
|
@ -315,6 +324,10 @@ var SeriesView = BaseView.extend({
|
|||
|
||||
enterIcon: function(ev) {
|
||||
var id = this.getEventID(ev);
|
||||
this.updateAboutForLevelID(id);
|
||||
},
|
||||
|
||||
updateAboutForLevelID: function(id) {
|
||||
var level = Main.getLevelArbiter().getLevel(id);
|
||||
this.setAbout(intl.getName(level));
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue