Skip to content

Commit

Permalink
=
Browse files Browse the repository at this point in the history
  • Loading branch information
arikaim-repository committed Apr 2, 2020
1 parent a84ba7b commit a2b742a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions form/clear/clear.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<a class="ui clear-button button {{ class }}" form-id="{{ form_id }}">
{{ title }}
</a>
12 changes: 12 additions & 0 deletions form/clear/clear.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

$(document).ready(function() {
arikaim.ui.button('.clear-button',function(element) {
var formId = $(element).attr('form-id');
if (isEmpty(formId) == false) {
$('#' + formId).form('reset');
} else {
$('.form').form('reset');
}
});
});
3 changes: 3 additions & 0 deletions form/clear/clear.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"title": "Clear"
}
3 changes: 3 additions & 0 deletions form/footer/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
{{ buttons.cancel.content }}
</a>
{% endif %}
{% if show_clear_button == true %}
{{ component('components:form.clear',{ form_id: form_id, class: clear_button_class }) }}
{% endif %}
<div class="ui error message errors hidden mt-2"></div>
<div class="ui success message hidden mt-2" id="message"></div>
</div>

0 comments on commit a2b742a

Please sign in to comment.