From 0b5f8f9492fa7fce42c3771f7843f8e8c13cc910 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Wed, 24 Sep 2014 10:26:51 +0200 Subject: [PATCH] Ox.UI.elements -> Ox.elements --- source/Ox.UI/js/Core/GarbageCollection.js | 12 ++++++------ source/Ox.UI/js/List/InfoList.js | 3 ++- source/Ox.UI/js/Map/Map.js | 2 +- source/Ox.UI/js/Video/AnnotationPanel.js | 2 +- source/Ox.UI/js/Video/VideoAnnotationPanel.js | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/source/Ox.UI/js/Core/GarbageCollection.js b/source/Ox.UI/js/Core/GarbageCollection.js index 01b13c2f..4d0cff06 100644 --- a/source/Ox.UI/js/Core/GarbageCollection.js +++ b/source/Ox.UI/js/Core/GarbageCollection.js @@ -16,17 +16,17 @@ Ox.GarbageCollection = (function() { collect(); function collect() { - var len = Ox.len(Ox.UI.elements); - Object.keys(Ox.UI.elements).forEach(function(id) { - var $element = Ox.UI.elements[id]; + var len = Ox.len(Ox.elements); + Object.keys(Ox.elements).forEach(function(id) { + var $element = Ox.elements[id]; if ($element && Ox.isUndefined($element.data('oxid'))) { $element.remove(); - delete Ox.UI.elements[id]; + delete Ox.elements[id]; } }); timeout && clearTimeout(timeout); timeout = setTimeout(collect, 60000); - Ox.Log('GC', len, '-->', Ox.len(Ox.UI.elements)); + Ox.Log('GC', len, '-->', Ox.len(Ox.elements)); } /*@ @@ -35,7 +35,7 @@ Ox.GarbageCollection = (function() { @*/ that.debug = function() { var classNames = {}, sorted = []; - Ox.forEach(Ox.UI.elements, function($element, id) { + Ox.forEach(Ox.elements, function($element, id) { var className = $element[0].className; classNames[className] = (classNames[className] || 0) + 1; }); diff --git a/source/Ox.UI/js/List/InfoList.js b/source/Ox.UI/js/List/InfoList.js index b4517e53..acc108e4 100644 --- a/source/Ox.UI/js/List/InfoList.js +++ b/source/Ox.UI/js/List/InfoList.js @@ -44,6 +44,7 @@ Ox.InfoList = function(options, self) { that.$element.options({sort: self.options.sort}); }, width: function() { + // FIXME: don't use classname for this lookup var width = getItemWidth(); $('.OxInfoElement').each(function() { var $parent = $(this).parent(), @@ -51,7 +52,7 @@ Ox.InfoList = function(options, self) { $parent.css({width: width - 144}); $parent.parent().css({width: width - 144}); $parent.parent().parent().css({width: width - 8}); - Ox.UI.elements[id].options({width: width - 152}); + Ox.elements[id].options({width: width - 152}); }); } }); diff --git a/source/Ox.UI/js/Map/Map.js b/source/Ox.UI/js/Map/Map.js index a482afcf..d850d902 100644 --- a/source/Ox.UI/js/Map/Map.js +++ b/source/Ox.UI/js/Map/Map.js @@ -598,7 +598,7 @@ Ox.Map = function(options, self) { function centerChanged() { var tooltip = $('.OxMapMarkerTooltip'); - tooltip.length && Ox.UI.elements[$(tooltip[0]).data('oxid')].hide(); + tooltip.length && Ox.elements[$(tooltip[0]).data('oxid')].hide(); self.center = self.map.getCenter(); self.centerChanged = true; } diff --git a/source/Ox.UI/js/Video/AnnotationPanel.js b/source/Ox.UI/js/Video/AnnotationPanel.js index 6e78ad16..a40df381 100644 --- a/source/Ox.UI/js/Video/AnnotationPanel.js +++ b/source/Ox.UI/js/Video/AnnotationPanel.js @@ -206,7 +206,7 @@ Ox.AnnotationPanel = function(options, self) { var id = data.id; Ox.InsertHTMLDialog(Ox.extend({ callback: function(data) { - Ox.UI.elements[id] + Ox.elements[id] .value(data.value) .focusInput(data.position) .triggerEvent('change', data.value); diff --git a/source/Ox.UI/js/Video/VideoAnnotationPanel.js b/source/Ox.UI/js/Video/VideoAnnotationPanel.js index 7b794396..a2ace59a 100644 --- a/source/Ox.UI/js/Video/VideoAnnotationPanel.js +++ b/source/Ox.UI/js/Video/VideoAnnotationPanel.js @@ -1274,7 +1274,7 @@ Ox.VideoAnnotationPanel = function(options, self) { if (Ox.isUndefined(data)) { // doubleclick on small timeline data = getAnnotation(); - } else if (!data.id && Ox.UI.elements[that.oxid]) { + } else if (!data.id && Ox.elements[that.oxid]) { // focus only if in the dom that.gainFocus(); }