Ox.UI: add 'loadCSS' load option

This commit is contained in:
rlx 2014-09-23 23:15:35 +02:00
parent a312ed2021
commit f476bd47af

View file

@ -4,6 +4,7 @@ Ox.load.UI = function(options, callback) {
options = Ox.extend({ options = Ox.extend({
hideScreen: true, hideScreen: true,
loadCSS: true,
showScreen: false, showScreen: false,
theme: 'oxlight' theme: 'oxlight'
}, options); }, options);
@ -233,7 +234,13 @@ Ox.load.UI = function(options, callback) {
Ox.getFile(Ox.PATH + 'Ox.UI/jquery/jquery.js?' + Ox.VERSION, function() { Ox.getFile(Ox.PATH + 'Ox.UI/jquery/jquery.js?' + Ox.VERSION, function() {
initUI(); initUI();
Ox.getJSON(Ox.UI.PATH + 'json/Ox.UI.json?' + Ox.VERSION, function(data) { Ox.getJSON(Ox.UI.PATH + 'json/Ox.UI.json?' + Ox.VERSION, function(data) {
var counter = 0, length = data.files.length; var counter = 0, length;
if (!options.loadCSS) {
data.files = data.files.filter(function(file) {
return !Ox.endsWith(file, '.css');
});
}
length = data.files.length;
images = data.images; images = data.images;
data.files.forEach(function(file) { data.files.forEach(function(file) {
if (/\.jsonc$/.test(file)) { if (/\.jsonc$/.test(file)) {