| OLD | NEW |
| 1 <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html
"> | 1 <link rel="import" href="chrome://resources/cr_elements/cr_dialog/cr_dialog.html
"> |
| 2 <link rel="import" href="chrome://resources/html/polymer.html"> | 2 <link rel="import" href="chrome://resources/html/polymer.html"> |
| 3 <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.htm
l"> | 3 <link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.htm
l"> |
| 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-ch
eckbox.html"> |
| 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt
on.html"> | 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt
on.html"> |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-ch
eckbox.html"> | |
| 6 <link rel="import" href="languages.html"> | 6 <link rel="import" href="languages.html"> |
| 7 <link rel="import" href="../settings_page/settings_subpage_search.html"> |
| 7 <link rel="import" href="../settings_shared_css.html"> | 8 <link rel="import" href="../settings_shared_css.html"> |
| 8 | 9 |
| 9 <dom-module id="settings-add-languages-dialog"> | 10 <dom-module id="settings-add-languages-dialog"> |
| 10 <template> | 11 <template> |
| 11 <style include="settings-shared"> | 12 <style include="settings-shared"> |
| 12 dialog { | 13 .body { |
| 14 -webkit-padding-end: 0 !important; |
| 13 display: flex; | 15 display: flex; |
| 14 flex-direction: column; | 16 flex-direction: column; |
| 17 height: 350px; |
| 18 overflow: auto; |
| 15 } | 19 } |
| 16 | 20 |
| 17 .body { | 21 settings-subpage-search { |
| 18 display: flex; | 22 -webkit-padding-end: 24px; |
| 19 flex-direction: column; | 23 } |
| 20 max-height: 250px; | 24 |
| 21 overflow: auto; | 25 iron-list { |
| 26 flex: 1; |
| 22 } | 27 } |
| 23 | 28 |
| 24 .ripple-padding { | 29 .ripple-padding { |
| 25 /* Create a little extra space for checkbox ink ripple to flow into. */ | 30 /* Create a little extra space for checkbox ink ripple to flow into. */ |
| 26 -webkit-padding-start: 20px; | 31 -webkit-padding-start: 20px; |
| 27 } | 32 } |
| 28 </style> | 33 </style> |
| 29 <dialog is="cr-dialog" id="dialog" close-text="$i18n{close}"> | 34 <dialog is="cr-dialog" id="dialog" close-text="$i18n{close}"> |
| 30 <div class="title">$i18n{addLanguagesDialogTitle}</div> | 35 <div class="title">$i18n{addLanguagesDialogTitle}</div> |
| 31 <div class="body"> | 36 <div class="body"> |
| 32 <!-- TODO(michaelpg): Dynamic language search/filtering. --> | 37 <settings-subpage-search label="[[searchLabel]]" |
| 38 on-search-changed="onSearchChanged_" autofocus> |
| 39 </settings-subpage-search> |
| 33 <iron-list class="ripple-padding" scroll-target="[[$$('.body')]]" | 40 <iron-list class="ripple-padding" scroll-target="[[$$('.body')]]" |
| 34 items="[[getAvailableLanguages_( | 41 items="[[getLanguages_( |
| 35 languages.supported, languages.enabled.*)]]"> | 42 languages.supported, languages.enabled.*, filterValue_)]]"> |
| 36 <template> | 43 <template> |
| 37 <paper-checkbox class="list-item" checked="[[willAdd_(item.code)]]" | 44 <paper-checkbox class="list-item" checked="[[willAdd_(item.code)]]" |
| 38 title$="[[item.nativeDisplayName]]" | 45 title$="[[item.nativeDisplayName]]" |
| 39 on-change="onLanguageCheckboxChange_" | 46 on-change="onLanguageCheckboxChange_" |
| 40 tabindex$="[[tabIndex]]"> | 47 tabindex$="[[tabIndex]]"> |
| 41 [[item.displayName]] | 48 [[item.displayName]] |
| 42 </paper-checkbox> | 49 </paper-checkbox> |
| 43 </template> | 50 </template> |
| 44 </iron-list> | 51 </iron-list> |
| 45 </div> | 52 </div> |
| 46 <div class="button-container"> | 53 <div class="button-container"> |
| 47 <div class="action-buttons"> | 54 <div class="action-buttons"> |
| 48 <paper-button class="cancel-button" on-tap="onCancelButtonTap_"> | 55 <paper-button class="cancel-button" on-tap="onCancelButtonTap_"> |
| 49 $i18n{cancel} | 56 $i18n{cancel} |
| 50 </paper-button> | 57 </paper-button> |
| 51 <paper-button class="action-button" on-tap="onActionButtonTap_" | 58 <paper-button class="action-button" on-tap="onActionButtonTap_" |
| 52 disabled="[[disableActionButton_]]"> | 59 disabled="[[disableActionButton_]]"> |
| 53 $i18n{add} | 60 $i18n{add} |
| 54 </paper-button> | 61 </paper-button> |
| 55 </div> | 62 </div> |
| 56 </div> | 63 </div> |
| 57 </dialog> | 64 </dialog> |
| 58 </template> | 65 </template> |
| 59 <script src="add_languages_dialog.js"></script> | 66 <script src="add_languages_dialog.js"></script> |
| 60 </dom-module> | 67 </dom-module> |
| OLD | NEW |