Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How to prevent duplication when overriding an event handler?
pavsid
New
Hi, i need to override ProfileController_AfterUserInfo_Handler
in YagaHooks
, but if I do this then both handlers are called.
Is there any way to prevent the original handler being called? I'm using 2.2.
Thanks
0
Best Answer
-
Bleistivt Moderator
You don't need a second div. Just set
white-space: nowrap;
on.DataCounts
to prevent line breaks.It's better to avoid vertical scrolling though.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
7
Answers
You cannot "override" that. Every plugin, addon, theme can use this event to add content and no usage will block the others.
You might be able to trick something, though...
The code in YAGA starts like that:
So if you manage to hook into ProfileController_AfterUserInfo before YAGA, you could set the setting 'Yaga.Reactions.Enabled' temporarily to false (
saveToConfig('Yaga.Reactions.Enabled', false, false)
) and you are done.What sounds easy might become a problem: I guess addons are executed before plugins and so you would have to write an addon instead. I don't know if themehooks run before or after addons so you can test if a custom theme would do the trick.
And if there is other YAGA content on that page, it might get disabled. So you would have to use the event YAGA hooks for such a second display, and "reenable" the config setting. All in all it is a quite ugly workaround.
It might be cleaner in this case to hide YAGAs div.Yaga.ReactionsWrap on this page with a CSS display:none rule
What are you looking to accomplish?
You could potentially extend the YagaHooks class, override the method, and deregister the original YagaHooks via a really early startup hook.
Perhaps there is an easier way if you discuss why you want to do this.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Hi both, thanks for your answers. All i really need to do is wrap another
div
arounddiv.DataCounts
!!In order to style it better for small screens.
I could/should split this out into a module with a view, then you could override the view easily. Perhaps an enhancement for 1.2.
That said, why would you need another
div
? That smells like a bad idea.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
So users on mobile devices can scroll sideways through the "reactions" by setting
overflow-x:scroll
on the outer div. I've styled them differently like so...It's not vital, i'm probably safer just going with @R_J 's suggestion of hiding the other div via CSS
You don't need a second div. Just set
white-space: nowrap;
on.DataCounts
to prevent line breaks.It's better to avoid vertical scrolling though.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
@Bleistivt - oh yeh....!! Thanks