Hi All,
I'm dreaming to get the Item Actions popping up in my theme on right clicking i.e. an image (or right clicking the page). I've made some thoughts based on Pedro's PGtheme - I have some ideas - only the final (most important) link is missing and I'm stuck here...
My Idea is to add a some code to the theme.js, replacing the pop-up message which is called in PGtheme by right clicking the page
var posX, posY="";
function rightcl(e) {
if (navigator.appName == 'Netscape' && (e.which == 2 || e.which == 3)) {
posX: window.event.x;
posY: window.event.y;
----> popup the actionbar
return false;
}
else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button == 3)) {
posX: window.event.x;
posY: window.event.y;
----> popup the actionbar
return false;
}
return true;
}
you see - here is where I'm stuck - how to tell the page to open the actionbar.tpl from Java at the mouse coordinates I've rightclicked - which should contain something like
<div id="actions" style="position: absolute; left: posX; top: posY;
z-index: 10; visibility: hidden;">
<div id="actionsIn" style="position: relative; left: 0px; top: 0px;
z-index: 10;" class="gcBackground1 gcBorder2">
{g->theme include="actionbar.tpl"}
</div>
In addition a new template, actionbar.tpl
<tr><td>
<div id="gsSidebar" class="gcBackground1 gcBorder1">
{* Show only the action block *}
{$theme.params.sidebarBlocks item=2}
{g->block type=$block.0 params=$block.1 class="gbBlock"}
</div>
</td></tr></table>
(I assumed the action block on the second position of the normal sidebar)
Any idea to bring me to a solution? Is this possible at all?
Posts: 157
LFrank,
Try this, at Theme.js cut this out:
and put this at the end of the file:
Is that wath you want?
Posts: 1023
Yep, nearly ... I try some finetuning on mouseposition and seperate meue
Many Thanks, Pedro !!