From c6d67420a8e7c857d928a6013e621889b6880cd1 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Fri, 30 Sep 2011 10:34:33 +0000 Subject: [PATCH] some fixes for map, range and videopreview --- source/Ox.UI/css/Ox.UI.css | 8 ++++ source/Ox.UI/js/Form/Ox.Range.js | 28 +++++++------- source/Ox.UI/js/List/Ox.List.js | 5 ++- source/Ox.UI/js/Map/Ox.Map.js | 47 +++++++++++++++++++----- source/Ox.UI/js/Panel/Ox.SplitPanel.js | 4 +- source/Ox.UI/js/Video/Ox.VideoPreview.js | 33 +++++++++++------ 6 files changed, 88 insertions(+), 37 deletions(-) diff --git a/source/Ox.UI/css/Ox.UI.css b/source/Ox.UI/css/Ox.UI.css index 12e2addf..9a709915 100644 --- a/source/Ox.UI/css/Ox.UI.css +++ b/source/Ox.UI/css/Ox.UI.css @@ -2118,6 +2118,14 @@ Video } .OxVideoPreview > .OxFrame { position: absolute; + left: 0; + top: 0; + right: 0; + bottom: 16px; + overflow: hidden; +} +.OxVideoPreview > OxFrame > img { + position: absolute; } .OxVideoPreview > .OxTimeline { position: absolute; diff --git a/source/Ox.UI/js/Form/Ox.Range.js b/source/Ox.UI/js/Form/Ox.Range.js index 9bdcd638..5b701fff 100644 --- a/source/Ox.UI/js/Form/Ox.Range.js +++ b/source/Ox.UI/js/Form/Ox.Range.js @@ -45,16 +45,16 @@ Ox.Range = function(options, self) { value: 0, valueNames: null, }) - .options(Ox.extend(options, { - arrowStep: options.arrowStep ? - options.arrowStep : options.step, - trackImages: $.makeArray(options.trackImages || []) - })) + .options(options || {}) .addClass('OxRange') .css({ width: self.options.size + 'px' }); + self.options.arrowStep = options.arrowStep || self.options.step; + self.options.trackImages = Ox.isArray(self.options.trackImages) + ? self.options.trackImages : [self.options.trackImages]; + Ox.extend(self, { trackColors: self.options.trackColors.length, trackImages: self.options.trackImages.length, @@ -145,7 +145,11 @@ Ox.Range = function(options, self) { function clickArrow(data, i, animate) { // fixme: shift doesn't work, see menu scrolling - setValue(self.options.value + self.options.arrowStep * (i == 0 ? -1 : 1) * (data.shiftKey ? 2 : 1), animate); + setValue( + self.options.value + + self.options.arrowStep * (i == 0 ? -1 : 1) * (data.shiftKey ? 2 : 1), + animate + ); } function clickTrack(data) { @@ -209,12 +213,12 @@ Ox.Range = function(options, self) { self.$thumb.stop().animate({ marginLeft: (getPx(self.options.value) - 1) + 'px', //width: self.thumbSize + 'px' - }, animate ? 200 : 0, function() { + }, animate ? 250 : 0, function() { if (self.options.thumbValue) { self.$thumb.options({ - title: self.options.valueNames ? - self.options.valueNames[self.options.value] : - self.options.value + title: self.options.valueNames + ? self.options.valueNames[self.options.value] + : self.options.value }); } }); @@ -240,9 +244,7 @@ Ox.Range = function(options, self) { //time = getTime(self.options.value, value); self.options.value = value; setThumb(animate); - that.triggerEvent('change', { - value: value - }); + that.triggerEvent('change', {value: value}); } } diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index 2d941a45..d3cc232b 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -662,6 +662,7 @@ Ox.List = function(options, self) { } function getWidth() { + //Ox.print('LIST THAT.WIDTH()', that.width()) return that.width() - (that.$content.height() > that.height() ? Ox.UI.SCROLLBAR_SIZE : 0); } @@ -731,9 +732,9 @@ Ox.List = function(options, self) { self.$items[pos].appendTo(self.$pages[page]); }); page == 0 && fillFirstPage(); - // fixme: why does emptyPage sometimes have no methods? + // FIXME: why does emptyPage sometimes have no methods? //Ox.print('emptyPage', $emptyPage) - $emptyPage.removeElement && $emptyPage.removeElement(); + $emptyPage && $emptyPage.removeElement && $emptyPage.removeElement(); self.$pages[page].appendTo(that.$content); !Ox.isUndefined(callback) && callback(); // fixme: callback necessary? why not bind to event? })); diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index 29066cd9..5f165d59 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -36,6 +36,7 @@ Ox.Map Basic map object showTypes If true, color markers according to place type statusbar If true, the map has a statusbar toolbar If true, the map has a toolbar + zoombar If true, the map has a zoombar self Shared private variable # EVENTS ------------------------------------------------------------------- addplace Fires when a place has been added @@ -73,6 +74,8 @@ Ox.Map Basic map object lat Latitude lng Longitude types <[s]> Types (like "country" or "political") + selectplace Fires when a place has been selected or deselected + place Place object # EXAMPLES -----------------------------------------------------------------