Skip to content
This repository has been archived by the owner on Nov 27, 2017. It is now read-only.

Commit

Permalink
fixed orientation changed event
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Allen committed Jan 13, 2011
1 parent 8548096 commit 3cbf8f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions www/controllers/project.js
Expand Up @@ -15,7 +15,7 @@ var ProjectController = PageController.extend({

if (APP.browser.isMobile) {
this.scroller = new iScroll(this.view.find(".TaskList ul"), { checkDOMChanges: false, desktopCompatibility: false });
window.addEventListener('orientationchange', this);
window.addEventListener('orientationChanged', this);
}

APP.bind("enableScrolling", function() {
Expand All @@ -32,7 +32,7 @@ var ProjectController = PageController.extend({
this.loadTasks();
},
destroy: function() {
window.removeEventListener('orientationchange', this);
window.removeEventListener('orientationChanged', this);
if (this.scroller)
this.scroller.destroy();
this.scroller = null;
Expand All @@ -51,7 +51,7 @@ var ProjectController = PageController.extend({
this._super(e);
var self = this;
switch (e.type) {
case "orientationchange":
case "orientationChanged":
setTimeout(function () { self.scroller.refresh(); }, 0);
break;
}
Expand Down
6 changes: 3 additions & 3 deletions www/controllers/project_list.js
Expand Up @@ -7,14 +7,14 @@ var ProjectListController = PageController.extend({

if (APP.browser.isMobile) {
this.scroller = new iScroll(this.view.find(".ProjectList ul"), { checkDOMChanges: false, desktopCompatibility: false });
window.addEventListener('orientationchange', this);
window.addEventListener('orientationChanged', this);
}

this.view.find(".Loading").style.display = "block";
this.loadProjects();
},
destroy: function() {
window.removeEventListener('orientationchange', this);
window.removeEventListener('orientationChanged', this);
if (this.scroller)
this.scroller.destroy();
this.scroller = null;
Expand All @@ -24,7 +24,7 @@ var ProjectListController = PageController.extend({
this._super(e);
var self = this;
switch (e.type) {
case "orientationchange":
case "orientationChanged":
setTimeout(function () { self.scroller.refresh(); }, 0);
break;
}
Expand Down

0 comments on commit 3cbf8f0

Please sign in to comment.