From b6c872b5a4bb3c14473657e3fd5506d383d9347e Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 29 Oct 2011 17:05:44 +0000 Subject: [PATCH] in Ox.Calendar tooltips, only display the text representation of an event's range if it's different from the event's name --- source/Ox.UI/js/Calendar/Ox.Calendar.js | 5 +++-- source/Ox.UI/js/Form/Ox.Select.js | 8 ++++++++ source/Ox.UI/js/List/Ox.List.js | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/source/Ox.UI/js/Calendar/Ox.Calendar.js b/source/Ox.UI/js/Calendar/Ox.Calendar.js index c163b758..dfa712dc 100644 --- a/source/Ox.UI/js/Calendar/Ox.Calendar.js +++ b/source/Ox.UI/js/Calendar/Ox.Calendar.js @@ -801,8 +801,9 @@ Ox.Calendar = function(options, self) { event, title; if ($target.is('.OxLine > .OxEvent')) { event = getEventById($target.data('id')); - title = '' + event.name + '
' + - event.rangeText + '
' + event.durationText; + title = '' + event.name + '
' + + (event.rangeText != event.name ? event.rangeText + '
' : '') + + event.durationText; } else { title = Ox.formatDate(getMouseDate(e), '%a, %b %e, %x, %H:%M:%S', true); } diff --git a/source/Ox.UI/js/Form/Ox.Select.js b/source/Ox.UI/js/Form/Ox.Select.js index e13f2472..e7012ec2 100644 --- a/source/Ox.UI/js/Form/Ox.Select.js +++ b/source/Ox.UI/js/Form/Ox.Select.js @@ -184,6 +184,14 @@ Ox.Select = function(options, self) { } }; + that.disableItem = function(id) { + self.$menu.getItem(id).options({disabled: true}); + }; + + that.enableItem = function(id) { + self.$menu.getItem(id).options({disabled: false}); + }; + // FIXME: selected() _and_ selectItem() _and_ value() ??? /*@ diff --git a/source/Ox.UI/js/List/Ox.List.js b/source/Ox.UI/js/List/Ox.List.js index ab625131..38049e0e 100644 --- a/source/Ox.UI/js/List/Ox.List.js +++ b/source/Ox.UI/js/List/Ox.List.js @@ -427,7 +427,7 @@ Ox.List = function(options, self) { var height = getHeight(), lastItemHeight = height % self.options.itemHeight || self.options.itemHeight, visibleItems = Math.ceil(height / self.options.itemHeight); - Ox.print('FILL', self.listLength, visibleItems); + //Ox.print('FILL', self.listLength, visibleItems); if (self.listLength < visibleItems) { Ox.range(self.listLength, visibleItems).forEach(function(v) { var $item = Ox.ListItem({