Note that there are some explanatory texts on larger screens.

plurals
  1. POK2 lightbox wont close on save
    primarykey
    data
    text
    <p>So this is somewhat common issue and the issue is I have a Joomla website with K2 extension and running the JAWall template. My problem is when a user wants to post an item in the frontend of my website and hits save the lightbox that pops up does not close. The post is added and there is some kind of update but the box stays. </p> <p>I have found a few forums that discuss the issue and a Google code bug report <a href="http://code.google.com/p/getk2/issues/detail?can=2&amp;start=0&amp;num=100&amp;q=&amp;colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20Opened&amp;groupby=&amp;sort=&amp;id=273" rel="nofollow">here</a> and again in the K2 forums <a href="http://getk2.org/community/New-to-K2-Ask-here-first/12931-Re-K2-front-end-save-and-close#160104" rel="nofollow">here</a> and again on the Joomla forums but none of them have a solution that works for my situation. I can add a </p> <pre><code>window.parent.location.reload() </code></pre> <p>And this will work but it will not wait if the user is uploading some media in their post. So how can I make this function wait for the upload? The code I am trying to add this to is long but the main chunk is at the top so I'll post that here to hopefully help someone understand the situation better.</p> <pre><code>&lt;?php // no direct access defined('_JEXEC') or die('Restricted access'); $document = &amp; JFactory::getDocument(); $document-&gt;addScriptDeclaration(" Joomla.submitbutton = function(pressbutton){ if (pressbutton == 'cancel') { submitform( pressbutton ); return; } if (\$K2.trim(\$K2('#title').val()) == '') { alert( '".JText::_('K2_ITEM_MUST_HAVE_A_TITLE', true)."' ); } else if (\$K2.trim(\$K2('#catid').val()) == '0') { alert( '".JText::_('K2_PLEASE_SELECT_A_CATEGORY', true)."' ); } else { syncExtraFieldsEditor(); \$K2('#selectedTags option').attr('selected', 'selected'); submitform( pressbutton ); //window.parent.location.reload();//this is what i added } } "); ?&gt; &lt;form action="index.php" enctype="multipart/form-data" method="post" name="adminForm" id="adminForm"&gt; &lt;?php if($this-&gt;mainframe-&gt;isSite()): ?&gt; &lt;div id="k2FrontendContainer"&gt; &lt;div id="k2Frontend"&gt; &lt;table class="k2FrontendToolbar" cellpadding="2" cellspacing="4"&gt; &lt;tr&gt; &lt;td id="toolbar-save" class="button"&gt; &lt;a class="toolbar" href="#" onclick="javascript: submitbutton('save'); return false;"&gt; &lt;span title="&lt;?php echo JText::_('K2_SAVE'); ?&gt;" class="icon-32-save"&gt;&lt;/span&gt;&lt;?php echo JText::_('K2_SAVE'); ?&gt; &lt;/a&gt; &lt;/td&gt; &lt;td id="toolbar-cancel" class="button"&gt; &lt;a class="toolbar" href="#" &gt; &lt;span title="&lt;?php echo JText::_('K2_CANCEL'); ?&gt;" class="icon-32-cancel"&gt;&lt;/span&gt; &lt;?php echo JText::_('K2_CLOSE'); ?&gt; &lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>If anyone has an idea to point me in the right direction I would appreciate it I'm here at work on a Saturday because of this issue!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload