Skip to content

Commit

Permalink
v0.2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
blocknotes committed Sep 13, 2020
1 parent 96c7d92 commit 0c237dc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ end
`f.input :title, input_html: { 'data-function': 'title_empty', 'data-then': 'slide', 'data-target': '#article_description_input' }`

```js
function title_empty( el ) {
return ( $('#article_title').val().trim() === '' );
function title_empty(el) {
return ($('#article_title').val().trim() === '');
}
```

Expand All @@ -77,10 +77,10 @@ function title_empty( el ) {
`f.input :published, input_html: { data: { if: 'checked', then: 'callback set_title', args: '["Unpublished !"]' } }`

```js
function set_title( args ) {
if( $('#article_title').val().trim() === '' ) {
$('#article_title').val( args[0] );
$('#article_title').trigger( 'change' );
function set_title(args) {
if($('#article_title').val().trim() === '') {
$('#article_title').val(args[0]);
$('#article_title').trigger('change');
}
}
```
Expand All @@ -90,10 +90,10 @@ function set_title( args ) {
`f2.input :category, as: :select, collection: [ [ 'Cat 1', 'cat1' ], [ 'Cat 2', 'cat2' ], [ 'Cat 3', 'cat3' ] ], input_html: { 'data-function': 'on_change_category' }`

```js
function on_change_category( el ) {
var target = el.closest( 'fieldset' ).find( '.pub' );
target.prop( 'checked', ( el.val() == 'cat2' ) );
target.trigger( 'change' );
function on_change_category(el) {
var target = el.closest('fieldset').find('.pub');
target.prop('checked', (el.val() == 'cat2');
target.trigger('change');
}
```
Expand Down
2 changes: 1 addition & 1 deletion lib/activeadmin/dynamic_fields/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module ActiveAdmin
module DynamicFields
VERSION = '0.2.8'
VERSION = '0.2.10'
end
end

0 comments on commit 0c237dc

Please sign in to comment.