window size alert

This commit is contained in:
Peter Cottle 2013-01-08 12:51:12 -08:00
parent 8bd5fb3196
commit 9b77632faf
4 changed files with 2315 additions and 3329 deletions

View file

@ -63,6 +63,11 @@ var init = function() {
events.trigger('resize', e);
});
$(window).on('windowSizeCheck', _.throttle(function(e) {
var width = $(window).width();
var height = $(window).height();
eventBaton.trigger('windowSizeCheck', {w: width, h: height});
}, 500));
eventBaton.stealBaton('docKeydown', function() { });
eventBaton.stealBaton('docKeyup', function() { });
@ -78,6 +83,13 @@ var init = function() {
var view = new Views.ZoomAlertWindow();
}
});
eventBaton.stealBaton('windowSizeCheck', function(size) {
if (size.w < Constants.VIEWPORT.minWidth ||
size.h < Constants.VIEWPORT.minHeight) {
var Views = require('../views');
var view = new Views.WindowSizeAlertWindow();
}
});
// the default action on window focus and document click is to just focus the text area
eventBaton.stealBaton('windowFocus', focusTextArea);