From f476bd47af37a01cd700325fc8b7387f650b33ec Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Tue, 23 Sep 2014 23:15:35 +0200 Subject: [PATCH] Ox.UI: add 'loadCSS' load option --- source/Ox.UI/Ox.UI.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/Ox.UI/Ox.UI.js b/source/Ox.UI/Ox.UI.js index f69d74ca..6d2b2cdc 100644 --- a/source/Ox.UI/Ox.UI.js +++ b/source/Ox.UI/Ox.UI.js @@ -4,6 +4,7 @@ Ox.load.UI = function(options, callback) { options = Ox.extend({ hideScreen: true, + loadCSS: true, showScreen: false, theme: 'oxlight' }, options); @@ -233,7 +234,13 @@ Ox.load.UI = function(options, callback) { Ox.getFile(Ox.PATH + 'Ox.UI/jquery/jquery.js?' + Ox.VERSION, function() { initUI(); 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; data.files.forEach(function(file) { if (/\.jsonc$/.test(file)) {