1
0
Fork 0
forked from 0x2620/oxjs

form elements rewrite, part 2

This commit is contained in:
rolux 2011-12-21 21:03:52 +05:30
commit 074902d079
33 changed files with 163 additions and 153 deletions

View file

@ -307,7 +307,7 @@ Ox.Calendar = function(options, self) {
.css({float: 'left', margin: '4px'})
.bindEvent({
change: function(data) {
self.options.showTypes = data.selected.map(function(type) {
self.options.showTypes = data.value.map(function(type) {
return type.id;
});
getLines();
@ -491,6 +491,7 @@ Ox.Calendar = function(options, self) {
self.$zoomInput = Ox.Range({
arrows: true,
changeOnDrag: true,
max: self.maxZoom,
min: 0,
size: self.options.width,
@ -1008,9 +1009,9 @@ Ox.Calendar = function(options, self) {
renderTimelines();
renderOverlay();
renderEvents();
self.$dateInput.options({
value: Ox.formatDate(self.options.date, '%Y-%m-%d %H:%M:%S', true)
});
self.$dateInput.value(
Ox.formatDate(self.options.date, '%Y-%m-%d %H:%M:%S', true)
);
}
function renderEvents() {
@ -1160,7 +1161,7 @@ Ox.Calendar = function(options, self) {
function zoomTo(zoom) {
self.options.zoom = Ox.limit(zoom, 0, self.maxZoom);
self.$zoomInput.options({value: self.options.zoom});
self.$zoomInput.value(self.options.zoom);
renderCalendar();
}

View file

@ -156,7 +156,7 @@ Ox.ListCalendar = function(options, self) {
})
.bindEvent({
change: function(data) {
var key = data.selected[0].id,
var key = data.value,
value = self.$findInput.value();
value && updateList(key, value);
}
@ -364,7 +364,7 @@ Ox.ListCalendar = function(options, self) {
self.$alternativeNamesInput.setErrors([exists]);
}
} else if (data.id == 'type') {
editEvent('type', data.data.selected[0].id);
editEvent('type', data.data.value);
} else if (data.id == 'start') {
editEvent('start', data.data.value);
} else if (data.id == 'end') {
@ -508,14 +508,14 @@ Ox.ListCalendar = function(options, self) {
if (key == 'name') {
self.$eventName.options({title: value});
} else if (['start', 'end'].indexOf(key) > -1) {
self.$durationInput.options({
value: Ox.formatDateRangeDuration(
self.$startInput.options('value'),
self.$endInput.options('value')
self.$durationInput.value(
Ox.formatDateRangeDuration(
self.$startInput.value(),
self.$endInput.value()
|| Ox.formatDate(new Date(), '%Y-%m-%d %H%:%M:%S'),
true
)
});
);
}
} else {
alert(result.status.text);