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 #30051 from zbraniecki/1137593-use-dir-instead-of-…
Browse files Browse the repository at this point in the history
…bidi-when-displaying-notifications

Bug 1137593 - Use notifcation options.dir instead of options.bidi. r=stas
  • Loading branch information
zbraniecki committed May 15, 2015
2 parents 27f6760 + b2dee03 commit d82f40e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
8 changes: 4 additions & 4 deletions apps/system/js/notifications.js
Expand Up @@ -417,8 +417,8 @@ var NotificationScreen = {
* which creates a UI mess we can't control by changing
* the system language.
*/
var dir = (detail.bidi === 'auto' || typeof detail.bidi === 'undefined') ?
document.documentElement.dir : detail.bidi;
var dir = (detail.dir === 'auto' || typeof detail.dir === 'undefined') ?
document.documentElement.dir : detail.dir;

// We need to animate the ambient indicator when the toast
// timesout, so we skip updating it here, by passing a skip bool
Expand All @@ -431,7 +431,7 @@ var NotificationScreen = {
notificationNode.dataset.notificationId = detail.id;
notificationNode.dataset.noClear = behavior.noclear ? 'true' : 'false';
notificationNode.lang = detail.lang;
notificationNode.dataset.predefinedDir = detail.bidi;
notificationNode.dataset.predefinedDir = detail.dir;

notificationNode.dataset.obsoleteAPI = 'false';
if (typeof detail.id === 'string' &&
Expand Down Expand Up @@ -494,7 +494,7 @@ var NotificationScreen = {
// but we still need to update type, lang and dir.
oldNotif.dataset.type = type;
oldNotif.lang = detail.lang;
oldNotif.dataset.predefinedDir = detail.bidi;
oldNotif.dataset.predefinedDir = detail.dir;

notificationNode = oldNotif;
} else {
Expand Down
Expand Up @@ -71,7 +71,7 @@
if (detailsA.lang && detailsB.lang !== detailsA.lang) {
return false;
}
if (detailsA.bidi && detailsB.bidi !== detailsA.bidi) {
if (detailsA.dir && detailsB.dir !== detailsA.dir) {
return false;
}
return true;
Expand Down
Expand Up @@ -119,9 +119,6 @@
if (detailsA.lang && detailsB.lang !== detailsA.lang) {
return false;
}
if (detailsA.bidi && detailsB.bidi !== detailsA.bidi) {
return false;
}
if (detailsA.dir && detailsB.dir !== detailsA.dir) {
return false;
}
Expand Down
3 changes: 0 additions & 3 deletions apps/system/test/marionette/lib/notification.js
Expand Up @@ -145,9 +145,6 @@ NotificationList.prototype = {
if (details.lang && notification.lang !== details.lang) {
continue;
}
if (details.bidi && notification.bidi !== details.bidi) {
continue;
}
if (details.dir && notification.dir !== details.dir) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/system/test/unit/notifications_test.js
Expand Up @@ -382,7 +382,7 @@ suite('system/NotificationScreen >', function() {
var detail = {icon: imgpath,
title: 'title',
detail: 'detail',
bidi: dir};
dir: dir};
NotificationScreen.addNotification(detail);
assert.equal(dir, toaster.dir);
var notificationNode =
Expand Down

0 comments on commit d82f40e

Please sign in to comment.