From 1bec2d29aeb3328a80ada747e7b86b0cdba4d5d8 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 6 Dec 2013 20:49:53 +0100 Subject: [PATCH] use Ox.documentReady; add Ox.UI.getOxElement(element) and Ox.UI.isOxElement(element) --- source/Ox.UI/Ox.UI.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/Ox.UI.js b/source/Ox.UI/Ox.UI.js index 45c2e2ae..407a980e 100644 --- a/source/Ox.UI/Ox.UI.js +++ b/source/Ox.UI/Ox.UI.js @@ -261,7 +261,7 @@ Ox.load.UI = function(options, callback) { Ox.Theme.getThemeData = function(theme) { return themes[theme || Ox.Theme()]; }; - $(function() { + Ox.documentReady(function() { if (options.showScreen && options.hideScreen) { Ox.UI.hideLoadingScreen(); } @@ -282,7 +282,7 @@ Ox.load.UI = function(options, callback) { @*/ Ox.UI.ready = (function() { var callbacks = []; - $(function() { + Ox.documentReady(function() { // FIXME: use Ox.$foo everywhere! Ox.$body = Ox.UI.$body = $('body'); Ox.$document = Ox.UI.$document = $(document); @@ -371,6 +371,10 @@ Ox.load.UI = function(options, callback) { return JSON.stringify(args); } }); + // ... + Ox.UI.getOxElement = function(element) { + return Ox.$elements[Ox.$(element).attr('data-oxid')]; + }; /*@ Ox.UI.hideLoadingScreen hide loading screen () -> hide loading screen @@ -399,6 +403,10 @@ Ox.load.UI = function(options, callback) { Ox.UI.isElement = function(object) { return Ox.isObject(object) && 'oxid' in object; }; + // ... + Ox.UI.isOxElement = function(element) { + return !!Ox.$(element).attr('data-oxid'); + }; //@ Ox.UI.PATH Path of Ox.UI Ox.UI.PATH = Ox.PATH + 'Ox.UI/'; //@ Ox.UI.SCOLLBAR_SIZE size of scrollbar