"src/render/texture_atlas/extract.rs" did not exist on "9ca2b0079f1e8b08bc4eeddb8f9c56b121dafdd3"
Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*globals console, mu */
(function () {
"use strict";
if (!window.mu) {
throw new Error("tinyDOM-Sideburns requires tinyDOM to be in use on the page");
}
mu.templates = {};
mu.render = function (path, data, options) {
if (mu.templates.hasOwnProperty(path)) {
return mu.templates[path](data, options);
} else {
return window.sideburns(path, data, options);
}
};
mu.fn.render = function (path, data, options) {
var rendered = mu.render(path, data, options),
opts = options || {useHtml: true};
if (typeof opts.useHtml === "undefined") {
opts.useHtml = true;
}
this.each(function (i, e) {
if (opts.useHtml) {
e.innerHTML = rendered;
} else {
e.textContent = rendered;
}
});
};
mu.ready(function () {
mu("[type='x-template/sideburns']").each(function (i, e) {
var name = e.getAttribute("data-name");
mu.templates[name] = window.sideburns.partial(e.textContent);
});
});
}());