in ListCalendar, populate duration form field, fixes #756

This commit is contained in:
rlx 2012-04-19 05:48:31 +00:00
parent 4ad7bc8ad4
commit 244312aede
2 changed files with 10 additions and 9 deletions

View file

@ -117,7 +117,6 @@ Ox.ListCalendar = function(options, self) {
}, },
{ {
format: function(value, data) { format: function(value, data) {
// return Ox.formatDateRangeDuration(data.start, data.end, true);
var key = data.start + ' - ' + data.end; var key = data.start + ' - ' + data.end;
if (!self.durationCache[key]) { if (!self.durationCache[key]) {
self.durationCache[key] = data.start self.durationCache[key] = data.start
@ -366,7 +365,7 @@ Ox.ListCalendar = function(options, self) {
}), }),
self.$durationInput = Ox.Input({ self.$durationInput = Ox.Input({
disabled: true, disabled: true,
id: 'durationText', id: 'duration',
label: 'Duration', label: 'Duration',
labelWidth: 64, labelWidth: 64,
width: 240 width: 240
@ -433,6 +432,7 @@ Ox.ListCalendar = function(options, self) {
width: 240 width: 240
}) })
.css({margin: '8px'}) .css({margin: '8px'})
.hide()
.appendTo(self.$eventData); .appendTo(self.$eventData);
} }
@ -480,8 +480,8 @@ Ox.ListCalendar = function(options, self) {
.appendTo(self.$eventStatusbar); .appendTo(self.$eventStatusbar);
} }
that.$element.replaceWith( that.setElement(
that.$element = Ox.SplitPanel({ Ox.SplitPanel({
elements: [ elements: [
{ {
collapsible: self.options.collapsible, collapsible: self.options.collapsible,
@ -545,7 +545,6 @@ Ox.ListCalendar = function(options, self) {
orientation: 'horizontal' orientation: 'horizontal'
}) })
.addClass('OxListMap') .addClass('OxListMap')
.$element
); );
// if loaded with selection, set calendar and form // if loaded with selection, set calendar and form
@ -755,7 +754,10 @@ Ox.ListCalendar = function(options, self) {
if (!isUndefined) { if (!isUndefined) {
self.$eventForm.values( self.$eventForm.values(
decodeValues(Ox.extend({}, event, { decodeValues(Ox.extend({}, event, {
end: event.current ? '' : event.end end: event.current ? '' : event.end,
duration: Ox.formatDateRangeDuration(
event.start, event.end, true
)
})) }))
).show(); ).show();
} else { } else {

View file

@ -701,8 +701,8 @@ Ox.ListMap = function(options, self) {
} }
*/ */
that.$element.replaceWith( that.setElement(
that.$element = Ox.SplitPanel({ Ox.SplitPanel({
elements: [ elements: [
{ {
collapsible: self.options.collapsible, collapsible: self.options.collapsible,
@ -771,7 +771,6 @@ Ox.ListMap = function(options, self) {
orientation: 'horizontal' orientation: 'horizontal'
}) })
.addClass('OxListMap') .addClass('OxListMap')
.$element
); );
function addPlace() { function addPlace() {