one event baton in practice, but keyboard is complicated...

This commit is contained in:
Peter Cottle 2013-01-01 14:14:57 -08:00
parent 0779bdeadb
commit 8e8eb4f4a9
5 changed files with 53 additions and 59 deletions

View file

@ -68,6 +68,10 @@ var MultiView = Backbone.View.extend({
this.start();
},
onWindowFocus: function() {
// nothing here for now...
},
getPromise: function() {
return this.deferred.promise;
},
@ -120,7 +124,7 @@ var MultiView = Backbone.View.extend({
// first we stop listening to keyboard and give that back to UI, which
// other views will take if they need to
this.keyboardListener.mute();
require('../app').getUI().modalEnd();
require('../app').getEventBaton().releaseBaton('windowFocus', this.onWindowFocus, this);
setTimeout(_.bind(function() {
_.each(this.childViews, function(childView) {
@ -132,7 +136,8 @@ var MultiView = Backbone.View.extend({
},
start: function() {
require('../app').getUI().modalStart();
// steal the window focus baton
require('../app').getEventBaton().stealBaton('windowFocus', this.onWindowFocus, this);
this.showViewIndex(this.currentIndex);
},