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

View file

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