Skip to content

Commit 5b91999

Browse files
committed
Change drop to drops to better align with opens option
1 parent 5a283a1 commit 5b91999

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ $('input[name="daterange"]').daterangepicker(
8686

8787
`opens`: (string: 'left'/'right'/'center') Whether the picker appears aligned to the left, to the right, or centered under the HTML element it's attached to
8888

89-
`drop`: (string: 'down' or 'up') Whether the picker opens below (default) or above the element it's attached to
89+
`drops`: (string: 'down' or 'up') Whether the picker opens below (default) or above the element it's attached to
9090

9191
`buttonClasses`: (array) CSS class names that will be added to all buttons in the picker
9292

daterangepicker.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@
132132
if (this.element.hasClass('pull-right'))
133133
this.opens = 'left';
134134

135-
this.drop = 'down';
135+
this.drops = 'down';
136136
if (this.element.hasClass('dropup'))
137-
this.drop = 'up';
137+
this.drops = 'up';
138138

139139
this.buttonClasses = ['btn', 'btn-small btn-sm'];
140140
this.applyClass = 'btn-success';
@@ -240,8 +240,8 @@
240240
if (typeof options.opens === 'string')
241241
this.opens = options.opens;
242242

243-
if (typeof options.drop === 'string')
244-
this.drop = options.drop;
243+
if (typeof options.drops === 'string')
244+
this.drops = options.drops;
245245

246246
if (typeof options.showWeekNumbers === 'boolean') {
247247
this.showWeekNumbers = options.showWeekNumbers;
@@ -561,11 +561,11 @@
561561
parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;
562562
}
563563

564-
if(this.drop=='up')
565-
containerTop=this.element.offset().top - this.container.outerHeight() - parentOffset.top;
564+
if (this.drops == 'up')
565+
containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
566566
else
567-
containerTop=this.element.offset().top + this.element.outerHeight() - parentOffset.top;
568-
this.container[this.drop=='up'?'addClass':'removeClass']('dropup');
567+
containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
568+
this.container[this.drops == 'up' ? 'addClass' : 'removeClass']('dropup');
569569

570570
if (this.opens == 'left') {
571571
this.container.css({

examples.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ <h4>And also can drop "up"</h4>
257257
<script type="text/javascript">
258258
$(document).ready(function() {
259259
$('#dropup').daterangepicker({
260-
drop:'up'
260+
drops:'up'
261261
});
262262
});
263263
</script>

0 commit comments

Comments
 (0)