Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: chrome/browser/resources/settings/languages_page/edit_dictionary_page.js

Issue 2808173003: [MD settings] resize iron list when template expands (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
diff --git a/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js b/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
index b276bf483fce906e43f5b345db7d3e6f8173ba80..ba0acc7c2ebef8d3a80f909916bd294e81d888dd 100644
--- a/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
+++ b/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js
@@ -122,6 +122,15 @@ Polymer({
if (index == -1) {
this.languageSettingsPrivate.addSpellcheckWord(word);
this.unshift('words_', word);
+ if (this.words_.length == 1) {
+ // When adding a word to an _empty_ list, the template is expanded. This
hcarmona 2017/04/10 23:19:39 nit: "This" is on both lines.
dschuyler 2017/04/10 23:26:23 Done.
+ // This a workaround to resize the iron-list as well.
+ // TODO(dschuyler): Remove this hack after iron-list no longer needs
+ // this workaround to update the list at the same time the template
+ // wrapping the list is expanded.
+ Polymer.dom.flush();
hcarmona 2017/04/10 22:35:07 Do you need both |flush| and iron-resize?
dschuyler 2017/04/10 23:13:57 Without the flush, the #list is not there to be fo
hcarmona 2017/04/10 23:19:39 Sounds good.
+ this.$$('#list').fire('iron-resize');
hcarmona 2017/04/10 22:35:07 this.$.list.fire(...)
dschuyler 2017/04/10 23:13:57 $ doesn't find the id, while $$ will find the id.
hcarmona 2017/04/10 23:19:39 Sounds good, I missed that this is in a dom-if.
+ }
}
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698