From 1deb6169423f8b2fb75e0e606c9a5021dab86a75 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 5 Nov 2011 17:27:11 +0000 Subject: [PATCH] catch some global vars --- source/Ox.UI/js/Calendar/Ox.Calendar.js | 2 +- source/Ox.UI/js/Core/Ox.URL.js | 2 +- source/Ox.UI/js/List/Ox.InfoList.js | 2 +- source/Ox.UI/js/List/Ox.List.js | 3 ++- source/Ox.UI/js/List/Ox.TextList.js | 2 +- source/Ox.UI/js/Menu/Ox.Menu.js | 4 ++-- source/Ox.UI/js/Window/Ox.Dialog.js | 2 +- source/Ox/js/Core.js | 1 - 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/Ox.UI/js/Calendar/Ox.Calendar.js b/source/Ox.UI/js/Calendar/Ox.Calendar.js index c844dfad..d10de657 100644 --- a/source/Ox.UI/js/Calendar/Ox.Calendar.js +++ b/source/Ox.UI/js/Calendar/Ox.Calendar.js @@ -891,7 +891,7 @@ Ox.Calendar = function(options, self) { units; self.units.reverse(); Ox.forEach(self.units, function(v, i) { - width = Math.round(v.seconds * pixelsPerSecond); + var width = Math.round(v.seconds * pixelsPerSecond); if (width >= self.minLabelWidth) { units = [self.units[i], self.units[i - 1]]; return false; diff --git a/source/Ox.UI/js/Core/Ox.URL.js b/source/Ox.UI/js/Core/Ox.URL.js index e10b0a49..59f798b5 100644 --- a/source/Ox.UI/js/Core/Ox.URL.js +++ b/source/Ox.UI/js/Core/Ox.URL.js @@ -265,7 +265,7 @@ Ox.URL = function(options) { function encodeValue(str) { // var chars = '/&|()=*:'; - var chars = '&|()=*'; + var chars = '&|()=*', ret = ''; str.split('').forEach(function(char) { var index = chars.indexOf(char); diff --git a/source/Ox.UI/js/List/Ox.InfoList.js b/source/Ox.UI/js/List/Ox.InfoList.js index 7e3b3aa3..d3fc3199 100644 --- a/source/Ox.UI/js/List/Ox.InfoList.js +++ b/source/Ox.UI/js/List/Ox.InfoList.js @@ -106,7 +106,7 @@ Ox.InfoList = function(options, self) { marginTop: '-2px', overflow: 'hidden' }) - .appendTo($info); + .appendTo($info), $item = Ox.Element() .css({ width: getItemWidth() - 8 + 'px', diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index 493994ea..f3a117af 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -797,7 +797,8 @@ Ox.List = function(options, self) { } function mousedown(data) { - var pos = findItemPosition(data); + var pos = findItemPosition(data), + $cell, clickable, editable; //self.hadFocus = that.hasFocus(); that.gainFocus(); if (pos > -1) { diff --git a/source/Ox.UI/js/List/Ox.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index 79a43420..d885570e 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -614,7 +614,7 @@ Ox.TextList = function(options, self) { //Ox.Log('List', 'getItem', id) var $item = null; that.$element.find('.OxItem').each(function() { - $this = $(this); + var $this = $(this); if ($this.data('id') == id) { $item = $this; return false; diff --git a/source/Ox.UI/js/Menu/Ox.Menu.js b/source/Ox.UI/js/Menu/Ox.Menu.js index 38523f27..2ff9fd72 100644 --- a/source/Ox.UI/js/Menu/Ox.Menu.js +++ b/source/Ox.UI/js/Menu/Ox.Menu.js @@ -350,7 +350,7 @@ Ox.Menu = function(options, self) { function mousemove(event) { var item, position, - $target = $(event.target); + $target = $(event.target), $parent = $target.parent(); if ($parent.is('.OxCell')) { $target = $parent; @@ -713,7 +713,7 @@ Ox.Menu = function(options, self) { 0, Ox.UI.$window.width() - that.width() ), top = offset.top + self.options.offset.top + (self.options.side == 'bottom' ? height : 0), - menuHeight = that.$content.outerHeight(); // fixme: why is outerHeight 0 when hidden? + menuHeight = that.$content.outerHeight(), // fixme: why is outerHeight 0 when hidden? menuMaxHeight = Math.floor(Ox.UI.$window.height() - top - 16); if (self.options.parent) { if (menuHeight > menuMaxHeight) { diff --git a/source/Ox.UI/js/Window/Ox.Dialog.js b/source/Ox.UI/js/Window/Ox.Dialog.js index 56617790..8903f4ff 100644 --- a/source/Ox.UI/js/Window/Ox.Dialog.js +++ b/source/Ox.UI/js/Window/Ox.Dialog.js @@ -536,7 +536,7 @@ Ox.Dialog = function(options, self) { } function setContent() { - var animate = !!self.$content + var animate = !!self.$content, isImage = !self.options.content.ox && self.options.content.is('img'); if (animate) { self.$content.animate({ diff --git a/source/Ox/js/Core.js b/source/Ox/js/Core.js index cfca5c1a..f341afa1 100644 --- a/source/Ox/js/Core.js +++ b/source/Ox/js/Core.js @@ -115,7 +115,6 @@ Ox.load = function() { length = Ox.len(modules); Ox.forEach(modules, function(options, module) { Ox.loadFile(Ox.PATH + 'Ox.' + module + '/Ox.' + module + '.js', function() { - Ox.print('?', module) Ox.load[module](options, function(s) { success += s; ++counter == length && callback(success == counter);