Improved issue #1591 - Improved js snipped for form channel (use div, not button for non modal forms).
This commit is contained in:
parent
bb2537b49b
commit
84ed5ee451
2 changed files with 18 additions and 1 deletions
|
@ -67,11 +67,15 @@ class App.ChannelForm extends App.ControllerSubContent
|
||||||
# rebuild preview
|
# rebuild preview
|
||||||
params.test = true
|
params.test = true
|
||||||
if params.modal
|
if params.modal
|
||||||
|
@$('.js-modal').removeClass('hide')
|
||||||
|
@$('.js-inlineForm').addClass('hide')
|
||||||
@$('.js-formInline').addClass('hide')
|
@$('.js-formInline').addClass('hide')
|
||||||
@$('.js-formBtn').removeClass('hide')
|
@$('.js-formBtn').removeClass('hide')
|
||||||
@$('.js-formBtn').ZammadForm(params)
|
@$('.js-formBtn').ZammadForm(params)
|
||||||
@$('.js-formBtn').text('Feedback')
|
@$('.js-formBtn').text('Feedback')
|
||||||
else
|
else
|
||||||
|
@$('.js-modal').addClass('hide')
|
||||||
|
@$('.js-inlineForm').removeClass('hide')
|
||||||
@$('.js-formBtn').addClass('hide')
|
@$('.js-formBtn').addClass('hide')
|
||||||
@$('.js-formInline').removeClass('hide')
|
@$('.js-formInline').removeClass('hide')
|
||||||
@$('.js-formInline').ZammadForm(params)
|
@$('.js-formInline').ZammadForm(params)
|
||||||
|
|
|
@ -132,7 +132,20 @@
|
||||||
|
|
||||||
<p><%- @T('You need to add the following Javascript code snippet to your web page') %>:</p>
|
<p><%- @T('You need to add the following Javascript code snippet to your web page') %>:</p>
|
||||||
|
|
||||||
<pre><code class="language-html js-paramsBlock"><button id="feedback-form">Feedback</button>
|
<pre class="js-modal"><code class="language-html js-code js-paramsBlock"><button id="feedback-form">Feedback</button>
|
||||||
|
|
||||||
|
<script id="zammad_form_script" src="<%= @baseurl %>/assets/form/form.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
$('#feedback-form').ZammadForm({
|
||||||
|
<span class="js-modal-params"></span>
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script></code></pre>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<pre class="js-inlineForm"><code class="language-html js-code js-paramsBlock"><div id="feedback-form">form will be placed in here</div>
|
||||||
|
|
||||||
<script id="zammad_form_script" src="<%= @baseurl %>/assets/form/form.js"></script>
|
<script id="zammad_form_script" src="<%= @baseurl %>/assets/form/form.js"></script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue