-
AuthorPosts
-
arucardx Friend
arucardx
- Join date:
- July 2010
- Posts:
- 346
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 21
- Thanked:
- 138 times in 104 posts
October 4, 2012 at 6:07 am #181179I see that the active state for “Image View” & “S,M,L,XL” button is saved and remembered by the browser until cookies are cleared. How is that done? The reason I’m asking this is because I have added a new button called “New Tab” as an alternative to the JA Wall Pop Up Preview.
[PHP]<li id=”toolbar-display”>
<dl>
<dt>Display</dt>
<dd id=”toolbar-display-newtab” class=”first last”><span><?php echo JText::_(‘New Tab’); ?></span></dd>
<dd id=”toolbar-display-imageview” class=”first last”><span><?php echo JText::_(‘TPL_TEXT_IMAGEVIEW’); ?></span></dd>
</dl>
</li>
[/PHP]Using a JavaScript in index.php, I was able to get the “New Tab” button to open articles in a new tab when its toggled active.
<script type="text/javascript">
jQuery(function ($) {
$('#toolbar-display-newtab').click(function () {
if ($(this).toggleClass('active')) {
$('.item-link').attr('target', '_blank');
} else {
$('.item-link').removeAttr('target');
}
});
});
</script>However, this active state is not remembered by the browser when moving to a different link. For example, moving to another category. The “New Tab” button still appears blue though, but the articles would not open in a new tab until I click on the “New Tab” button.
My guess is a jquery cookie is used to store and read the active state for “ImageView” and “S,M,L,XL” buttons but the script for my “New Tab” button is not reading the cookie.
So basically, I would like to integrate my “New Tab” button into that cookie as well, but how can I do that? If this is considered customization beyond support, could you at least show me how active state are saved in JA Wall and where I can find that code in JA Wall? I’ve tried looking for the code to “ImageView” but could not figure out where it is.
-
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by HeR0 12 years, 1 month ago.
We moved to new unified forum. Please post all new support queries in our New Forum