-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address TODO - LanguageBehavior is now offered by the generic Propert…
…iesFromAncestorBehavior so use it + bonus: thanks to PropertiesFromAncestorBehavior supporting value changes, we can now allow user to see all translations in a single demo, so let's do that
- Loading branch information
1 parent
e1d5ef7
commit ee61cbe
Showing
9 changed files
with
88 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1.0.x | ||
v1.1.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<link rel="import" href="../../polymer/polymer.html" /> | ||
<dom-module id="container-with-lang-choice"> | ||
<template> | ||
<label> | ||
Interface Language: | ||
<select id="languageSelect" value="{{lang::input}}"></select> | ||
</label> | ||
<content select="*"></content> | ||
</template> | ||
</dom-module> | ||
<script> | ||
Polymer({ | ||
is: "container-with-lang-choice", | ||
properties: { | ||
lang: { | ||
notify: true, | ||
reflectToAttribute: true, | ||
}, | ||
availableLanguagesExpr: { | ||
type: String, | ||
observer: '_availableLanguagesExprChanged', | ||
}, | ||
availableLanguages: { | ||
type: Array, | ||
observer: '_availableLanguagesChanged', | ||
}, | ||
}, | ||
_availableLanguagesExprChanged: function (availableLanguagesExpr) { | ||
this.availableLanguages = eval(availableLanguagesExpr); | ||
}, | ||
_availableLanguagesChanged: function (availableLanguages) { | ||
// adding options here instead in <template> to suport IE11 - https://github.com/Polymer/polymer/issues/1735 | ||
|
||
this.$.languageSelect.innerHTML = ''; | ||
|
||
for (var i = 0; i < availableLanguages.length; ++i) { | ||
var option = document.createElement('option'); | ||
option.innerText = availableLanguages[i]; | ||
this.$.languageSelect.appendChild(option); | ||
} | ||
}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters