Commit afd5fb86c317abcfebf40f3fbed6d698ced3f734

extracted method clearSelectedClass

Commit diff

public/javascripts/calendar_date_select/calendar_date_select.js

 
327327 this.updateFooter(hover_date.toFormattedString(this.use_time));
328328 },
329329 dayHoverOut: function(element) { this.updateFooter(); },
330 clearSelectedClass: function() {if (this.selected_cell) this.selected_cell.removeClassName("selected");},
330331 setSelectedClass: function() {
331332 if (!this.selection_made) return;
332
333 // clear selection
334 if (this.selected_cell) this.selected_cell.removeClassName("selected");
335
333 this.clearSelectedClass()
336334 if ($R(0,42).include( days_until = this.beginning_date.stripTime().daysDistance(this.selected_date.stripTime()) )) {
337335 this.selected_cell = this.calendar_day_grid[days_until];
338336 this.selected_cell.addClassName("selected");
434434 if (e.keyCode==Event.KEY_ESC) this.close();
435435 },
436436 callback: function(name, param) { if (this.options.get(name)) { this.options.get(name).bind(this.target_element)(param); } }
437}
437}
438
toggle raw diff