summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/local_omnibox_popup
diff options
context:
space:
mode:
authorjeremycho@chromium.org <jeremycho@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-21 12:57:43 +0000
committerjeremycho@chromium.org <jeremycho@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-21 12:57:43 +0000
commit8ac53402a3031d1e7078f2c8c0e132d2ffbe36b7 (patch)
treed89411e5cd83142e23fbcd852c6994a0c5eed2e1 /chrome/browser/resources/local_omnibox_popup
parentac2e2acd50d662bfb99c6bbd98a69a5c4b5911f9 (diff)
downloadchromium_src-8ac53402a3031d1e7078f2c8c0e132d2ffbe36b7.zip
chromium_src-8ac53402a3031d1e7078f2c8c0e132d2ffbe36b7.tar.gz
chromium_src-8ac53402a3031d1e7078f2c8c0e132d2ffbe36b7.tar.bz2
Fix RTL for the local popup by setting the alignment to match the Chromium display language.
BUG=222289 Review URL: https://chromiumcodereview.appspot.com/12806005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189587 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/local_omnibox_popup')
-rw-r--r--chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.css3
-rw-r--r--chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js4
2 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.css b/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.css
index 8693862..dd2e55d 100644
--- a/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.css
+++ b/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.css
@@ -19,8 +19,7 @@ body {
-webkit-border-radius: 2px;
background: -webkit-image-set(
url('images/page_icon.png') 1x,
- url('images/2x/page_icon.png') 2x)
- 5px 4px no-repeat;
+ url('images/2x/page_icon.png') 2x) no-repeat;
padding-bottom: 2px;
padding-top: 3px;
white-space: nowrap;
diff --git a/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js b/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js
index 2f49fd6..7d1de2a 100644
--- a/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js
+++ b/chrome/browser/resources/local_omnibox_popup/local_omnibox_popup.js
@@ -236,11 +236,14 @@ function updateSuggestions() {
*/
function appendSuggestionStyles() {
var apiHandle = getApiObjectHandle();
+ var isRtl = apiHandle.rtl;
var style = document.createElement('style');
style.type = 'text/css';
style.id = 'suggestionStyle';
style.textContent =
'.suggestion {' +
+ ' background-position: ' +
+ (isRtl ? '-webkit-calc(100% - 5px)' : '5px') + ' 4px;' +
' -webkit-margin-start: ' + apiHandle.startMargin + 'px;' +
' width: ' + apiHandle.width + 'px;' +
' font: ' + apiHandle.fontSize + 'px "' + apiHandle.font + '";' +
@@ -303,6 +306,7 @@ function setUpApi() {
apiHandle.onkeypress = handleKeyPress;
apiHandle.onsubmit = onSubmit;
appendSuggestionStyles();
+ $('suggestions-box-container').dir = apiHandle.rtl ? 'rtl' : 'ltr';
if (apiHandle.nativeSuggestions.length)
handleNativeSuggestions();