PDA

View Full Version : Javascript links in popup menus!


mousi
05-07-2006, 10:00 PM
What is this hack?
Have you ever noticed that when there are links in the popup menus that use javascript, you must click on the text for the link to work? For example try "Quick Links->Open Buddy List" in this forum. If you just click on the td area and not on the text, the popup window doesn't show up.

You can fix this with this hack!

Modification:
1)Open ./clientscript/vbulletin_menu.js

2)Find:
tds[i].onclick = vB_Popup_Events.prototype.menuoption_onclick_link;

3)Replace it with:
var alphas = fetch_tags(tds[i], 'a');
if (alphas[0].onclick) {
tds[i].onclick = alphas[0].onclick;
} else {
tds[i].onclick = vB_Popup_Events.prototype.menuoption_onclick_link;
}

That's it. Now if you have a link like the following in a popup, it will work if you click on the entire td area:
<td class="vbmenu_option"><a href="#" onclick="doSomething();">Something</a></td>

This is my first hack. It's not something big, but I think it's usefull. If you like it please click Install (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=115025).

Ahsin1
05-08-2006, 01:49 AM
Screen Shots?

mousi
05-08-2006, 03:41 AM
Screen Shots?
Added one

yinyang
05-08-2006, 04:18 AM
demo?

mousi
05-08-2006, 04:30 AM
Not available demo right now... I will update later

Boofo
05-08-2006, 06:14 AM
Can't you just do the label tags for this? ;)

mousi
05-08-2006, 06:24 AM
Can't you just do the label tags for this? ;)
Hmmm... I didn't understand this! What do you mean? Do what with label tags?

htscpl
05-08-2006, 03:33 PM
*** installs ***

Not sure if it works or not. Most of my popup menus already had click on the box feature. In the 'User CP' is where I wanted it to work but those are not popups so not sure ??

Snake
05-08-2006, 06:47 PM
Thanks man!

mousi
05-08-2006, 08:49 PM
*** installs ***

Not sure if it works or not. Most of my popup menus already had click on the box feature. In the 'User CP' is where I wanted it to work but those are not popups so not sure ??
These are not that kind of links. They are just simple <a href="something.php"> links. I know those worked fine ;)