better highlighting with keyboard events for level dropdown view

This commit is contained in:
Peter Cottle 2013-10-06 11:49:18 -07:00
parent 9e24c2dfa2
commit 33e5060ac7
5 changed files with 40 additions and 3 deletions

View file

@ -23159,6 +23159,15 @@ var LevelDropdownView = ContainedBase.extend({
this.selectedID = id; this.selectedID = id;
var selector = '#levelIcon-' + id; var selector = '#levelIcon-' + id;
$(selector).toggleClass('selected', value); $(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() { negative: function() {
@ -23280,6 +23289,10 @@ var SeriesView = BaseView.extend({
enterIcon: function(ev) { enterIcon: function(ev) {
var id = this.getEventID(ev); var id = this.getEventID(ev);
this.updateAboutForLevelID(id);
},
updateAboutForLevelID: function(id) {
var level = Main.getLevelArbiter().getLevel(id); var level = Main.getLevelArbiter().getLevel(id);
this.setAbout(intl.getName(level)); this.setAbout(intl.getName(level));
}, },
@ -34530,6 +34543,15 @@ var LevelDropdownView = ContainedBase.extend({
this.selectedID = id; this.selectedID = id;
var selector = '#levelIcon-' + id; var selector = '#levelIcon-' + id;
$(selector).toggleClass('selected', value); $(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() { negative: function() {
@ -34651,6 +34673,10 @@ var SeriesView = BaseView.extend({
enterIcon: function(ev) { enterIcon: function(ev) {
var id = this.getEventID(ev); var id = this.getEventID(ev);
this.updateAboutForLevelID(id);
},
updateAboutForLevelID: function(id) {
var level = Main.getLevelArbiter().getLevel(id); var level = Main.getLevelArbiter().getLevel(id);
this.setAbout(intl.getName(level)); this.setAbout(intl.getName(level));
}, },

File diff suppressed because one or more lines are too long

1
build/bundle.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -445,7 +445,7 @@
For a much easier time perusing the source, see the individual files at: For a much easier time perusing the source, see the individual files at:
https://github.com/pcottle/learnGitBranching 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 advantage of github pages: super-easy, simple, slick static hostic.
The downside? No raw logs to parse for analytics, so I have to include The downside? No raw logs to parse for analytics, so I have to include

View file

@ -194,6 +194,15 @@ var LevelDropdownView = ContainedBase.extend({
this.selectedID = id; this.selectedID = id;
var selector = '#levelIcon-' + id; var selector = '#levelIcon-' + id;
$(selector).toggleClass('selected', value); $(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() { negative: function() {
@ -315,6 +324,10 @@ var SeriesView = BaseView.extend({
enterIcon: function(ev) { enterIcon: function(ev) {
var id = this.getEventID(ev); var id = this.getEventID(ev);
this.updateAboutForLevelID(id);
},
updateAboutForLevelID: function(id) {
var level = Main.getLevelArbiter().getLevel(id); var level = Main.getLevelArbiter().getLevel(id);
this.setAbout(intl.getName(level)); this.setAbout(intl.getName(level));
}, },