• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Hide Poll options when creating a thread

Oh wow it worked.

It wouldn't work for me with 1.0.4, but it saved right away with 1.1.1. Weird, but def awesome.
 
I got it to work nicely but it always makes me nervous to replace a large amount of code all at once.
So I went through it and made notes on exactly where to insert 3 bits of new code.

FIRST
Rich (BB code):
<input type="submit" value="{xen:phrase create_thread}" accesskey="s" class="button primary" />
<xen:include template="attachment_upload_button" />
<!– ADD –>  <input type="button" value="{xen:phrase post_poll}" class="button DisableOnSubmit JsOnly" id="button_post_poll") />
<!– END ADD –>

SECOND
Rich (BB code):
<xen:hook name="thread_create_fields_extra" params="{xen:array 'forum={$forum}'}" />
<!– ADD –>  <div id="post_poll" style="display:none">
<!– END ADD –>]

THIRD
Rich (BB code):
    <input type="submit" value="{xen:phrase create_thread}" class="button primary" />
    <input type="button" value="{xen:phrase preview}..." class="button PreviewButton JsOnly" />
        </dd>
    </dl>
 
<!– ADD –>  </div>
<script>$('#button_post_poll').click(function() {
  $('#post_poll').slideToggle();
});</script>
<!– END ADD –>
 
<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
</form>
<xen:comment><xen:include template="editor" /></xen:comment>

Thank you to Marcus for the code and for explaining which parts are additions.
 
Top Bottom