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

Commit

Permalink
Merge pull request #13085 from gasolin/issue-929889
Browse files Browse the repository at this point in the history
Bug 929889 - Remove 'portrait-primary' lock in system app, r=alive
  • Loading branch information
gasolin committed Oct 25, 2013
2 parents 0535641 + b4d0ef2 commit 8a0f40c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
8 changes: 4 additions & 4 deletions apps/system/js/attention_screen.js
Expand Up @@ -137,8 +137,8 @@ var AttentionScreen = {
// alternatively, if the newly appended frame is the visible frame
// and we are in the status bar mode, expend to full screen mode.
if (!this.isVisible()) {
// Attention screen now only support portrait mode.
screen.mozLockOrientation('portrait-primary');
// Attention screen now only support default orientation.
screen.mozLockOrientation(ScreenLayout.defaultOrientation);

this.attentionScreen.classList.add('displayed');
this.mainScreen.classList.add('attention');
Expand Down Expand Up @@ -240,8 +240,8 @@ var AttentionScreen = {

// expend the attention screen overlay to full screen
show: function as_show() {
// Attention screen now only support portrait mode.
screen.mozLockOrientation('portrait-primary');
// Attention screen now only support default orientation.
screen.mozLockOrientation(ScreenLayout.defaultOrientation);

this.attentionScreen.lastElementChild.dataset.appRequestedSmallSize = false;

Expand Down
4 changes: 2 additions & 2 deletions apps/system/js/cards_view.js
Expand Up @@ -172,8 +172,8 @@ var CardsView = (function() {
cardsView.addEventListener('mousedown', CardsView);
}

// Make sure we're in portrait mode
screen.mozLockOrientation('portrait-primary');
// Make sure we're in default orientation
screen.mozLockOrientation(ScreenLayout.defaultOrientation);

// If there is a displayed app, take keyboard focus away
if (displayedApp)
Expand Down
3 changes: 1 addition & 2 deletions apps/system/js/lockscreen.js
Expand Up @@ -825,8 +825,7 @@ var LockScreen = {
this.overlay.classList.remove('no-transition');

this.mainScreen.classList.add('locked');

screen.mozLockOrientation('portrait-primary');
screen.mozLockOrientation(ScreenLayout.defaultOrientation);

if (!wasAlreadyLocked) {
if (document.mozFullScreen)
Expand Down
4 changes: 2 additions & 2 deletions apps/system/js/sleep_menu.js
Expand Up @@ -100,8 +100,8 @@ var SleepMenu = {
this.elements.container.innerHTML = '';
this.buildMenu(this.generateItems());
this.elements.overlay.classList.add('visible');
// Lock orientation to portrait
screen.mozLockOrientation('portrait-primary');
// Lock to default orientation
screen.mozLockOrientation(ScreenLayout.defaultOrientation);
},

buildMenu: function sm_buildMenu(items) {
Expand Down
7 changes: 6 additions & 1 deletion apps/system/test/unit/cards_view_test.js
Expand Up @@ -5,6 +5,7 @@
mocha.setup({ignoreLeaks: true});

requireApp('system/test/unit/mock_gesture_detector.js');
requireApp('system/test/unit/mock_screen_layout.js');
requireApp('system/test/unit/mock_trusted_ui_manager.js');
requireApp('system/test/unit/mock_utility_tray.js');
requireApp('system/test/unit/mock_window_manager.js');
Expand All @@ -14,6 +15,7 @@ requireApp('system/test/unit/mock_popup_manager.js');

var mocksForCardsView = new MocksHelper([
'GestureDetector',
'ScreenLayout',
'TrustedUIManager',
'UtilityTray',
'WindowManager',
Expand All @@ -25,7 +27,7 @@ var mocksForCardsView = new MocksHelper([
suite('cards view >', function() {
var subject;

var screenNode, realMozLockOrientation;
var screenNode, realMozLockOrientation, realScreenLayout;
var cardsView;

mocksForCardsView.attachTestHelpers();
Expand All @@ -39,13 +41,16 @@ suite('cards view >', function() {

screenNode.appendChild(cardsView);
document.body.appendChild(screenNode);
realScreenLayout = window.ScreenLayout;
window.ScreenLayout = MockScreenLayout;
realMozLockOrientation = screen.mozLockOrientation;
screen.mozLockOrientation = MockLockScreen.mozLockOrientation;
requireApp('system/js/cards_view.js', done);
});

suiteTeardown(function() {
screenNode.parentNode.removeChild(screenNode);
window.ScreenLayout = realScreenLayout;
screen.mozLockOrientation = realMozLockOrientation;
});

Expand Down

0 comments on commit 8a0f40c

Please sign in to comment.