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
35
gaia/apps/sms/views/shared/js/shared_components.js
Executable file
35
gaia/apps/sms/views/shared/js/shared_components.js
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
|
||||
/*global Map, Template*/
|
||||
|
||||
/*exported SharedComponents */
|
||||
|
||||
(function(exports) {
|
||||
|
||||
var cachedTemplates = new Map();
|
||||
|
||||
var getTemplate = function(id) {
|
||||
if (!cachedTemplates.has(id)) {
|
||||
cachedTemplates.set(id, Template(id));
|
||||
}
|
||||
return cachedTemplates.get(id);
|
||||
};
|
||||
|
||||
var SharedComponents = {
|
||||
phoneDetails: function(details, interpolationOptions) {
|
||||
if (!details) {
|
||||
throw new Error('Phone details are required!');
|
||||
}
|
||||
|
||||
return getTemplate('phone-details-tmpl').prepare({
|
||||
type: details.type || '',
|
||||
number: details.number || '',
|
||||
carrier: details.carrier || '',
|
||||
hasTypeClass: !!details.type ? 'has-phone-type' : '',
|
||||
hasCarrierClass: !!details.carrier ? 'has-phone-carrier' : ''
|
||||
}, interpolationOptions);
|
||||
}
|
||||
};
|
||||
|
||||
exports.SharedComponents = SharedComponents;
|
||||
})(window);
|
||||
Loading…
Reference in a new issue