MyBB Community Forums

Full Version: MentionMe 3.2.12 (for MyAlerts 2.x)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I maintian the BootBB theme and am trying to solve a problem with the SCEditor popup. 

MentionMe popup is at the wrong location (goes down and to the right) because of this code (autocomplete.js, line 1362):

left = pi(coords.left) + containerOffset.left + pi(this.$container.css("paddingLeft").replace("px", "")) + fontSize + 2;
top = pi(coords.top + this.$container.find("div.sceditor-toolbar").height()) + containerOffset.top + pi(this.$container.css("paddingTop").replace("px", "")) + 6;

this.popup.show(left, top);

If I remove containerOffset.left and containerOffset.top from the sums, then everything works perfectly.

The above two variables have roughly the same values in Default theme and in BootBB, but I could not figure out why they are necessary in Default, and not in BootBB. Is there something I can add to my theme to make the popup work correctly?

BootBB is a responsive theme built with Bootstrap and uses no tables (here is my test site: https://mybb.panayot.com)
(2019-06-27, 11:23 PM)panayot Wrote: [ -> ]The above two variables have roughly the same values in Default theme and in BootBB, but I could not figure out why they are necessary in Default, and not in BootBB. Is there something I can add to my theme to make the popup work correctly?

First of all, nice theme. I've recently added it to my list of themes that are ready to integrate with ASB.

To the matter at hand, IIRC the container offset is for the toolbar in SCEditor. Another user asked me to look at this, but I just haven't had time. I will get the weekend off, so let me try again then and maybe I can take a look at it.

Sorry that you are having problems.
Thank you Wildcard!

I am not the author of BootBB, just helping maintain it as author has been busy for the last year. I am not a proffesional in CSS but if I can help you with ASB, do not hesitate to contact me.

For the toolbar height there is another expression I think:

this.$container.find("div.sceditor-toolbar").height())

while the two containerOffset expressions measure the offset of the div belonging to the theme (this is the div where all sceditor things go)

Maybe the easiest fix will be if theme developers can add a class to this div named for example "mentionme-no-offset" and your javascript will not include these offsets in the calculation if the class is present.

Of course I am not still sure if the problem is not within BootBB.
(2019-06-28, 09:29 PM)panayot Wrote: [ -> ]Thank you Wildcard!

You are welcome. Smile

(2019-06-28, 09:29 PM)panayot Wrote: [ -> ]I am not the author of BootBB, just helping maintain it as author has been busy for the last year. I am not a proffesional in CSS but if I can help you with ASB, do not hesitate to contact me.

Thanks. I may take you up on that. Cool

(2019-06-28, 09:29 PM)panayot Wrote: [ -> ]For the toolbar height there is another expression I think:
[...]
Of course I am not still sure if the problem is not within BootBB.

I will be able to look first thing in the morning. The approach I lean toward is a direct comparison from the default theme to see what has changed that could affect how MentionMe sets up its container element.

I should have news soon.
(2019-06-24, 07:51 PM)Wildcard Wrote: [ -> ]Thanks. When I make it home tonight, I will try to give it a test and see what we can do to fix you up.

Hi! Was that problem fixed? I am having a very simillar problem, but the autocompletion doesn't show in the middle of the text box, but under it (near the post reply button). I am using NetPen Pro theme and the newest MentionMe plugin.
(2019-07-08, 08:13 AM)Weasel-L Wrote: [ -> ]Hi! Was that problem fixed? I am having a very simillar problem, but the autocompletion doesn't show in the middle of the text box, but under it (near the post reply button). I am using NetPen Pro theme and the newest MentionMe plugin.

Can you just try uninstalling and installing again?
The problem that @erich199 and @Weasel-L have looks the same to the one I have described a little above. 

This problem happens with custom themes. Here is a way to fix it until there is an official fix from @Wildcard. If you use this fix, it will however displace the popup window for the Default Mybb theme, so if your forum users are allowed to use both themes there is no way to make it work simultaneously for both of them.

1. Edit file jscripts/MentionMe/autocomplete.js

At around line 1362, you will see following two lines:


left = pi(coords.left) + containerOffset.left + pi(this.$container.css("paddingLeft").replace("px", "")) + fontSize + 2;
top = pi(coords.top + this.$container.find("div.sceditor-toolbar").height()) + containerOffset.top + pi(this.$container.css("paddingTop").replace("px", "")) + 6;


Replace them with:

left = pi(coords.left) + pi(this.$container.css("paddingLeft").replace("px", "")) + fontSize + 2;
top = pi(coords.top + this.$container.find("div.sceditor-toolbar").height()) + pi(this.$container.css("paddingTop").replace("px", "")) + 6;

2. In plugin settings, set option "Minify JavaScript?" to No
Wildcard - tried that a couple of times but nothing changed.
Panayot - thanks, but that makes it look better only when I use "new reply". Upon quick reply it now shows up at the top of the page so it's even worse... Sad
On my theme (BootBB) works correctly both in the "quick reply" and on the "new reply" and unfortunately I do not know what to advise you.

The edit I suggested is in the function that is called only when the rich text editor (sceditor) is loaded. So it should not affect the quick reply (unless you have a theme or plugin that converts the quick reply to a rich text editor - by default the quick reply should look like here on mybb, without buttons).
I am using Quick Advanced Editor Plus so that may be it. Any idea how to make it also work considering I use it for quick replies and PMs?

EDIT: ...oh and even before I used the Quick Advanced Editor Plus, the problem was already there. Just previously it appeared ner the "post reply" button and now it's on the top of the thread.