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 #31886 from gmarty/Bug-1202740-Enter-search-addres…
Browse files Browse the repository at this point in the history
…s-replaced-New-home-screen-switching-locales

Bug 1202740 - [new homescreen] 'Enter search or address' is replaced by 'New home screen' when switching locales. r=apastor
  • Loading branch information
BavarianTomcat committed Sep 18, 2015
2 parents dcf00cb + 2e41dc2 commit fe53f73
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
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
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 fe53f73

Please sign in to comment.