Skip to content

Commit

Permalink
Implemented data-ajax-prepend
Browse files Browse the repository at this point in the history
  • Loading branch information
pepakriz committed Apr 29, 2014
1 parent a40c770 commit bc2bc6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nette.ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@ $.nette.ext('snippets', {
applySnippet: function ($el, html, back) {
if (!back && $el.is('[data-ajax-append]')) {
$el.append(html);
} else if (!back && $el.is('[data-ajax-prepend]')) {
$el.prepend(html);
} else {
$el.html(html);
}
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ Ajaxification of element ensures, that `e.preventDefault()` will be called. This

New content of snippet with this attribute won't replace the old content, but it will rather be appended to it.

### `data-ajax-prepend` (in `snippets` extension)

New content of snippet with this attribute won't replace the old content, but it will rather be prepended to it.

### `data-ajax-validate` (in `validation` extension)

Click on link or submittion of form is validated on various conditions. You can switch any of them:
Expand Down

0 comments on commit bc2bc6d

Please sign in to comment.