Skip to content

Commit 8d2e293

Browse files
author
Gena Maliy
committed
typo fix; fix compability with activeadmin v1.0.0.pre4
1 parent 974299b commit 8d2e293

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ $(document).on('ready', function(){
8080
});
8181
```
8282

83-
Now all you "date_time_range" inputs has button "Set rage"
83+
Now all you "date_time_range" inputs has button "Set range"
8484

8585

8686
## Custom usage
@@ -96,7 +96,7 @@ $(document).on('ready', function(){
9696
});
9797
});
9898
```
99-
".any_jquery_selector" is pointed to place where button "Set rage" will appear.
99+
".any_jquery_selector" is pointed to place where button "Set range" will appear.
100100
Set lteq_input and gteq_input to point to inputs if they not near main selector.
101101

102102

Rakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
require "bundler/gem_tasks"
2-
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ActiveAdminDateRangePreset
2-
VERSION = "0.1.0"
2+
VERSION = "0.3.0"
33
end

vendor/assets/javascripts/active_admin_date_range_preset.coffee

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@
5252
if options.lteq_input
5353
lteq_input = $(options.lteq_input)
5454
else
55-
lteq_input = if $this.hasClass('datetime_preset_pair') then $this.next().find('input') else $this.find('input[id$=_lteq]')
55+
lteq_input = if $this.hasClass('datetime_preset_pair') then $this.next().find('input') else $this.find('input:last')
5656
if options.gteq_input
5757
gteq_input = $(options.gteq_input)
5858
else
59-
gteq_input = if $this.hasClass('datetime_preset_pair') then $this.find('input') else $this.find('input[id$=_gteq]')
59+
gteq_input = if $this.hasClass('datetime_preset_pair') then $this.find('input') else $this.find('input:first')
6060

6161
# filter modifying
6262
main_btn_html = '<a href="#" class="btn_timerange">Set range</a>'
@@ -76,7 +76,7 @@
7676

7777
additional_items_html = ''
7878
opts.add_range.forEach (el, i)->
79-
additional_items_html += '<div><span class="btn_date_rage_' + i + '">' + el['title'] + '</span></div>'
79+
additional_items_html += '<div><span class="btn_date_range_' + i + '">' + el['title'] + '</span></div>'
8080

8181
$('body').append('<div style="min-width: '+e.target.offsetWidth+'px; top: '+(e.target.offsetTop)+'px; left: '+(e.target.offsetLeft)+'px" class="block_timerange">' +
8282
'<div><span class="btn_today">Today</span></div>' +
@@ -90,9 +90,9 @@
9090
).ready(->
9191
container = $(this).find('.block_timerange')
9292

93-
# additional rages
93+
# additional ranges
9494
opts.add_range.forEach (el, i)->
95-
$(container).on('click.CalendarRangeSet', '.btn_date_rage_' + i, (e)->
95+
$(container).on('click.CalendarRangeSet', '.btn_date_range_' + i, (e)->
9696
unbindClickEventBlockTimerange()
9797
start = new Date(el['start'].getFullYear(), el['start'].getMonth(), el['start'].getDate())
9898
end = new Date(el['end'].getFullYear(), el['end'].getMonth(), el['end'].getDate())

0 commit comments

Comments
 (0)