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

Commit

Permalink
Bug 1202740 - [new homescreen] 'Enter search or address' is replaced …
Browse files Browse the repository at this point in the history
…by 'New home screen' when switching locales
  • Loading branch information
gmarty committed Sep 17, 2015
1 parent 94db16e commit 2e41dc2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/system/js/app_chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,11 @@
if (this._fixedTitle) {
return;
}
this.title.textContent = this.app.name;
if (!this.app.isHomescreen && !this.isSearchApp()) {
this.title.textContent = this.app.name;
} else {
this.title.setAttribute('data-l10n-id', 'search-or-enter-address');
}
};

AppChrome.prototype.handleScrollAreaChanged = function(evt) {
Expand Down
13 changes: 13 additions & 0 deletions apps/system/test/unit/app_chrome_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,19 @@ suite('system/AppChrome', function() {
assert.equal(chrome.title.textContent, 'Phone2');
});

test('should not update the name of homescreen on change', function() {
var app = new AppWindow(cloneConfig(fakeWebSite));
app.isHomescreen = true;
app.name = 'Home Screen';
var chrome = new AppChrome(app);
assert.equal(chrome.title.textContent, '');

app.name = 'Home Screen 2';
var evt = new CustomEvent('_namechanged');
app.element.dispatchEvent(evt);
assert.equal(chrome.title.textContent, '');
});

test('localized app is not immediately overridden by titlechange event',
function() {
var app = new AppWindow(cloneConfig(fakeWebSite));
Expand Down

0 comments on commit 2e41dc2

Please sign in to comment.