Skip to content

Commit

Permalink
Merge pull request #2 from tmoore42six/master
Browse files Browse the repository at this point in the history
added css files
  • Loading branch information
Jon Lee authored Dec 9, 2016
2 parents 4a4383f + 51ce973 commit 951c4a9
Show file tree
Hide file tree
Showing 14 changed files with 135 additions and 26 deletions.
4 changes: 4 additions & 0 deletions dist/css/bootstrap-datepicker.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
color: #999999;
cursor: default;
}
.datepicker table tr td.highlighted {
background: #d9edf7;
border-radius: 0;
}
.datepicker table tr td.today,
.datepicker table tr td.today:hover,
.datepicker table tr td.today.disabled,
Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap-datepicker.min.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dist/css/bootstrap-datepicker.standalone.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
color: #999999;
cursor: default;
}
.datepicker table tr td.highlighted {
background: #d9edf7;
border-radius: 0;
}
.datepicker table tr td.today,
.datepicker table tr td.today:hover,
.datepicker table tr td.today.disabled,
Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap-datepicker.standalone.min.css

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions dist/css/bootstrap-datepicker3.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
.datepicker-dropdown {
top: 0;
left: 0;
padding: 4px;
}
.datepicker-dropdown:before {
content: '';
Expand Down Expand Up @@ -113,6 +114,10 @@
color: #999999;
cursor: default;
}
.datepicker table tr td.highlighted {
background: #d9edf7;
border-radius: 0;
}
.datepicker table tr td.today,
.datepicker table tr td.today:hover,
.datepicker table tr td.today.disabled,
Expand Down Expand Up @@ -749,3 +754,9 @@ fieldset[disabled] .datepicker table tr td span.active.disabled:hover.active {
margin-left: -5px;
margin-right: -5px;
}
.ptsEventsPicker {
overflow-y: scroll;
max-height: 300px;
margin-right: -9px;
padding-right: 9px;
}
2 changes: 1 addition & 1 deletion dist/css/bootstrap-datepicker3.min.css

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions dist/css/bootstrap-datepicker3.standalone.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
.datepicker-dropdown {
top: 0;
left: 0;
padding: 4px;
}
.datepicker-dropdown:before {
content: '';
Expand Down Expand Up @@ -113,6 +114,10 @@
color: #999999;
cursor: default;
}
.datepicker table tr td.highlighted {
background: #d9edf7;
border-radius: 0;
}
.datepicker table tr td.today,
.datepicker table tr td.today:hover,
.datepicker table tr td.today.disabled,
Expand Down Expand Up @@ -749,6 +754,12 @@ fieldset[disabled] .datepicker table tr td span.active.disabled:hover.active {
margin-left: -5px;
margin-right: -5px;
}
.ptsEventsPicker {
overflow-y: scroll;
max-height: 300px;
margin-right: -9px;
padding-right: 9px;
}
.datepicker.dropdown-menu {
position: absolute;
top: 100%;
Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap-datepicker3.standalone.min.css

Large diffs are not rendered by default.

108 changes: 89 additions & 19 deletions dist/js/bootstrap-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@
this.viewDate = this.o.defaultViewDate;
this.focusDate = null;

this.monthsWithEvents = [];
this.monthsWithEvents = [1,2,3,4,5,6,7,8,9,10,11,12];
this.selectedNonMonthlyEvents = {};
this.nonMonthlyEvents = [];

this.element = $(element);
this.isInline = false;
Expand Down Expand Up @@ -576,6 +578,44 @@
return this;
},

setSelectedEvents: function(){
var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
this.selectedNonMonthlyEvents = {}

for (index in args) {
var event = args[index]
this.selectedNonMonthlyEvents[event.EventId] = event.EventName;
}

return this;
},

clearSelectedEvents: function() {
this.selectedNonMonthlyEvents = {};
this.picker.find('.ptsEvent').removeClass('active')
return this;
},

setNonMonthlyEvents: function() {
this.nonMonthlyEvents = arguments[0];
},

renderEvents: function() {
var specialEvents = arguments[0];
this.nonMonthlyEvents = specialEvents

var html = '<td colspan="7"><div class="ptsEventsPicker">';
for (var _i = 0; _i < specialEvents.length; _i++){
var tempEvent = specialEvents[_i];
var selectedClass = this.selectedNonMonthlyEvents.hasOwnProperty(tempEvent.EventId) ? "active" : ""
html += '<div class="ptsEvent ' + selectedClass + '" data-eventId="'+ tempEvent.EventId +'">'+ tempEvent.EventName +'</div>';
}
html += '</div></td>'
this.picker.find('.datepicker-months .ptsEvents').html(html);

return this;
},

setUTCDates: function(){
var args = $.isArray(arguments[0]) ? arguments[0] : arguments;
this.update.apply(this, $.map(args, this._utc_to_local));
Expand Down Expand Up @@ -1100,17 +1140,22 @@

var elem = $(this.element).closest('[ng-controller]')
var controller = angular.element(elem).controller()

if (controller === undefined) {
elem = elem.context;

while (elem.parentElement !== undefined && controller == undefined) {
elem = elem.parentElement;
controller = angular.element(elem).controller()
}

}

var specialEvents = _.filter(controller.events, function(event) {
return event.EventDesc != "Monthly";
return event.Monthly;
})

var html = '<td colspan="7">';
for (var _i = 0; _i < specialEvents.length; _i++){
var tempEvent = specialEvents[_i];
html += '<div class="ptsEvent" data-eventId="'+ tempEvent.EventId +'">'+ tempEvent.EventName +'</div>';
}
html += '</td>'
this.picker.find('.datepicker-months .ptsEvents').html(html);
this.renderEvents(specialEvents)

break;
}
Expand All @@ -1137,17 +1182,12 @@

var elem = $(this.element).closest('[ng-controller]')
var controller = angular.element(elem).controller()

var specialEvents = _.filter(controller.events, function(event) {
return event.EventDesc != "Monthly";
return !event.Monthly;
})

var html = '<td colspan="7">';
for (var _i = 0; _i < specialEvents.length; _i++){
var tempEvent = specialEvents[_i];
html += '<div class="ptsEvent" data-eventId="'+ tempEvent.EventId +'">'+ tempEvent.EventName +'</div>';
}
html += '</td>'
this.picker.find('.datepicker-months .ptsEvents').html(html);
this.renderEvents(specialEvents);

break;
case 'switchMonths':
Expand All @@ -1165,8 +1205,38 @@
if (target.hasClass('ptsEvent')) {
var elem = $(this.element).closest('[ng-controller]')
var controller = angular.element(elem).controller()
controller.setEventById($(target).data('eventid'))
this.hide()

if (controller === undefined) {
elem = elem.context;

while (elem.parentElement !== undefined && controller == undefined) {
elem = elem.parentElement;
controller = angular.element(elem).controller()
}

}

var eventId = $(target).data('eventid')
var eventName = $(target).html()

if (!this.o.multievent) {
controller.setEventById($(target).data('eventid'))
this.selectedNonMonthlyEvents = {}
this.selectedNonMonthlyEvents[eventId] = eventName
target.parent().find('.ptsEvent').removeClass('active')
target.addClass('active')
this.hide()
}
else if (!this.selectedNonMonthlyEvents.hasOwnProperty(eventId)) {
target.addClass('active')
controller.setEventById($(target).data('eventid'))
this.selectedNonMonthlyEvents[eventId] = eventName
}
else {
target.removeClass('active')
delete this.selectedNonMonthlyEvents[eventId]
controller.removeEventById(eventId)
}
}
break;
case 'span':
Expand Down
3 changes: 2 additions & 1 deletion dist/js/bootstrap-datepicker.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/locales/bootstrap-datepicker.eo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/locales/bootstrap-datepicker.pl.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/bootstrap-datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@
var specialEvents = arguments[0];
this.nonMonthlyEvents = specialEvents

var html = '<td colspan="7"><div class="eventsPicker">';
var html = '<td colspan="7"><div class="ptsEventsPicker">';
for (var _i = 0; _i < specialEvents.length; _i++){
var tempEvent = specialEvents[_i];
var selectedClass = this.selectedNonMonthlyEvents.hasOwnProperty(tempEvent.EventId) ? "active" : ""
Expand Down
7 changes: 7 additions & 0 deletions less/datepicker3.less
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,10 @@
margin-right: -5px;
}
}

.ptsEventsPicker {
overflow-y: scroll;
max-height: 300px;
margin-right: -9px;
padding-right: 9px;
}

0 comments on commit 951c4a9

Please sign in to comment.