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 #18143 from lissyx/bug994262
Browse files Browse the repository at this point in the history
Bug 994262 - Make sure ModalDialog has title set r=alive
  • Loading branch information
lissyx committed Apr 10, 2014
2 parents 679dc48 + fa0b15d commit d81043d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/system/js/modal_dialog.js
Expand Up @@ -199,7 +199,7 @@ var ModalDialog = {
elements.prompt.classList.add('visible');
elements.promptInput.value = evt.detail.initialValue;
elements.promptMessage.innerHTML = message;
this.setTitle('prompt', '');
this.setTitle('prompt', title);
elements.promptOk.textContent = evt.yesText ? evt.yesText : _('ok');
elements.promptCancel.textContent = evt.noText ?
evt.noText : _('cancel');
Expand All @@ -209,7 +209,7 @@ var ModalDialog = {
case 'confirm':
elements.confirm.classList.add('visible');
elements.confirmMessage.innerHTML = message;
this.setTitle('confirm', '');
this.setTitle('confirm', title);
elements.confirmOk.textContent = evt.yesText ? evt.yesText : _('ok');
elements.confirmCancel.textContent = evt.noText ?
evt.noText : _('cancel');
Expand Down
11 changes: 11 additions & 0 deletions apps/system/test/unit/modal_dialog_test.js
Expand Up @@ -75,6 +75,9 @@ suite('system/ModalDialog >', function() {
});

assert.isTrue(ModalDialog.elements.selectOne.classList.contains('visible'));
assert.isNull(
ModalDialog.elements.selectOneTitle.innerHTML.match(
testObject.dialogTitle));

ModalDialogCleanUp();
});
Expand All @@ -89,6 +92,9 @@ suite('system/ModalDialog >', function() {
);

assert.isTrue(ModalDialog.elements.confirm.classList.contains('visible'));
assert.isNotNull(
ModalDialog.elements.confirmTitle.innerHTML.match(
testObject.dialogTitle));
assert.isNotNull(
ModalDialog.elements.confirmMessage.innerHTML.match(
testObject.dialogText));
Expand All @@ -108,6 +114,8 @@ suite('system/ModalDialog >', function() {
testObject.dialogTitle);

assert.isTrue(ModalDialog.elements.alert.classList.contains('visible'));
assert.isNotNull(
ModalDialog.elements.alertTitle.innerHTML.match(testObject.dialogTitle));
assert.isNotNull(
ModalDialog.elements.alertMessage.innerHTML.match(testObject.dialogText));

Expand All @@ -124,6 +132,9 @@ suite('system/ModalDialog >', function() {
);

assert.isTrue(ModalDialog.elements.prompt.classList.contains('visible'));
assert.isNotNull(
ModalDialog.elements.promptTitle.innerHTML.match(
testObject.dialogTitle));
assert.isNotNull(
ModalDialog.elements.promptMessage.innerHTML.match(
testObject.dialogText));
Expand Down

0 comments on commit d81043d

Please sign in to comment.