Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
40
gaia/apps/settings/js/panels/themes/layout_template.js
Executable file
40
gaia/apps/settings/js/panels/themes/layout_template.js
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
/**
|
||||
* The template function for generating an UI element for a layout object.
|
||||
*
|
||||
* @module themes/layout_template
|
||||
*/
|
||||
|
||||
define(function (require) {
|
||||
'use strict';
|
||||
|
||||
return function th_layoutTemplate(theme, recycled) {
|
||||
var container = null;
|
||||
var label, radio;
|
||||
var RADIO_GROUP = 'personalization.themesheader.value';
|
||||
if (recycled) {
|
||||
container = recycled;
|
||||
radio = container.querySelector('gaia-radio');
|
||||
label = container.querySelector('label');
|
||||
} else {
|
||||
container = document.createElement('li');
|
||||
radio = document.createElement('gaia-radio');
|
||||
label = document.createElement('label');
|
||||
|
||||
radio.name = RADIO_GROUP;
|
||||
radio.value = theme.manifestURL;
|
||||
|
||||
radio.appendChild(label);
|
||||
container.appendChild(radio);
|
||||
}
|
||||
label.textContent = theme.name;
|
||||
|
||||
radio.addEventListener('click', function(evt) {
|
||||
if (evt.target.checked) {
|
||||
return;
|
||||
}
|
||||
theme.onclick(theme.manifestURL);
|
||||
});
|
||||
return container;
|
||||
};
|
||||
});
|
||||
|
||||
Loading…
Reference in a new issue