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 #24319 from EragonJ/bug-1071387
Browse files Browse the repository at this point in the history
Bug 1071387 - [Settings] STK icons are missing and SIM labels is above o...
  • Loading branch information
EragonJ committed Sep 25, 2014
2 parents f349250 + 19358ab commit e57d1ff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
23 changes: 14 additions & 9 deletions apps/settings/js/icc_menu.js
Expand Up @@ -71,15 +71,8 @@
' (' + menu[SIMNumber].iccId + ') - ', menu[SIMNumber].entries);

var li = document.createElement('li');
// XXX this line requires a better l10n support, see bug 968853
if (Object.keys(menu).length > 1) {
var small = document.createElement('small');
small.textContent = 'SIM ' + SIMNumber;
small.classList.add('menu-item-desc');
li.appendChild(small);
}
var a = document.createElement('a');
a.textContent = menu[SIMNumber].entries.title;

a.id = 'menuItem-icc-' + menu[SIMNumber].iccId;
a.className = 'menu-item menuItem-icc';
a.href = '#icc';
Expand All @@ -93,8 +86,20 @@
window.dispatchEvent(event);
});
};
li.appendChild(a);

var span = document.createElement('span');
span.textContent = menu[SIMNumber].entries.title;
a.appendChild(span);

// XXX this line requires a better l10n support, see bug 968853
if (Object.keys(menu).length > 1) {
var small = document.createElement('small');
small.textContent = 'SIM ' + SIMNumber;
small.classList.add('menu-item-desc');
a.appendChild(small);
}

li.appendChild(a);
iccEntries.appendChild(li);

iccMainHeader.hidden = false;
Expand Down
4 changes: 2 additions & 2 deletions apps/settings/test/unit/icc_menu_test.js
Expand Up @@ -130,7 +130,7 @@ suite('STK (Main menu) >', function() {

test('Operator name (SIM 1) showed in the list', function() {
assert.equal(document.querySelector(
'#icc-entries li a').textContent, 'DummyOperator');
'#icc-entries li span').textContent, 'DummyOperator');
});

test('SIM number (SIM 1) showed in the list', function() {
Expand All @@ -140,7 +140,7 @@ suite('STK (Main menu) >', function() {

test('Operator name (SIM 2) showed in the list', function() {
assert.equal(document.querySelector(
'#icc-entries li:nth-child(2) a').textContent, 'DummyOperator');
'#icc-entries li:nth-child(2) span').textContent, 'DummyOperator');
});

test('SIM number (SIM 2) showed in the list', function() {
Expand Down

0 comments on commit e57d1ff

Please sign in to comment.