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 #25143 from gmarty/Bug-1061969-fix
Browse files Browse the repository at this point in the history
Bug 1082650 - Utility tray must consider software home button
  • Loading branch information
gmarty committed Oct 15, 2014
2 parents a177679 + c9ea74f commit 6446367
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions apps/system/js/utility_tray.js
Expand Up @@ -2,7 +2,7 @@
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */

'use strict';
/* global CostControl */
/* global CostControl, softwareButtonManager */

var UtilityTray = {
shown: false,
Expand Down Expand Up @@ -321,7 +321,8 @@ var UtilityTray = {

this.notifications.style.transition = '';
this.notifications.style.transform =
'translateY(' + (window.innerHeight - dy - 30 /* StatusBar */) + 'px)';
'translateY(' + (window.innerHeight - dy - 30 /* StatusBar */ -
softwareButtonManager.height) + 'px)';
},

onTouchEnd: function ut_onTouchEnd(touch) {
Expand Down
2 changes: 1 addition & 1 deletion apps/system/style/utility_tray/utility_tray.css
Expand Up @@ -70,6 +70,6 @@

@media (orientation: landscape) {
#screen.software-button-enabled #utility-tray-notifications {
width: calc(100% - var(--software-home-button-height));
width: calc(100%);
}
}
10 changes: 9 additions & 1 deletion apps/system/test/unit/utility_tray_test.js
Expand Up @@ -5,12 +5,14 @@
requireApp('system/shared/test/unit/mocks/mock_lazy_loader.js');
requireApp('system/test/unit/mock_app_window.js');
requireApp('system/test/unit/mock_statusbar.js');
requireApp('system/test/unit/mock_software_button_manager.js');
require('/shared/test/unit/mocks/mock_system.js');

var mocksHelperForUtilityTray = new MocksHelper([
'LazyLoader',
'System',
'StatusBar'
'StatusBar',
'SoftwareButtonManager'
]);
mocksHelperForUtilityTray.init();

Expand All @@ -19,6 +21,7 @@ suite('system/UtilityTray', function() {
var fakeEvt;
var fakeElement;
var originalLocked;
var originalSoftwareButtonManager;
mocksHelperForUtilityTray.attachTestHelpers();

function createEvent(type, bubbles, cancelable, detail) {
Expand Down Expand Up @@ -51,6 +54,9 @@ suite('system/UtilityTray', function() {
}

setup(function(done) {
originalSoftwareButtonManager = window.softwareButtonManager;
window.softwareButtonManager = window.MocksoftwareButtonManager;

var statusbar = document.createElement('div');
statusbar.style.cssText = 'height: 100px; display: block;';

Expand Down Expand Up @@ -107,6 +113,8 @@ suite('system/UtilityTray', function() {
stubById.restore();
window.System.locked = false;
window.System.currentApp = null;

window.softwareButtonManager = originalSoftwareButtonManager;
});

suite('show', function() {
Expand Down

0 comments on commit 6446367

Please sign in to comment.