Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Menu Error: checkHideMenu is not defined #24

Closed
cflinspach opened this issue Jul 17, 2017 · 4 comments
Closed

Menu Error: checkHideMenu is not defined #24

cflinspach opened this issue Jul 17, 2017 · 4 comments
Labels

Comments

@cflinspach
Copy link

I set headermenu=0 however we were still getting the following when we opened the module in Icingaweb2:

Javascript error occured: Uncaught ReferenceError: checkHideMenu is not defined http://nsicinga.ad.ccsd.net/nagvis/frontend/nagvis-js/js/NagVisCompressed.js?v=1.9.2 (4489)

The error would go away when we selected "Show Nagvis Menu" from the dropdown in Icingaweb2.

We were able to fix the error by changing lines 7 and 17 in configuration.php from

$section = $this->menuSection(N_('Maps'))
    ->setUrl('nagvis/show/map')
    ->setIcon('globe');

and

    $section->add($caption, array(
        'url'           => 'nagvis/show/map',
        'urlParameters' => array('map' => $name),
        'priority'      => ++$prio
    ));

to

$section = $this->menuSection(N_('Maps'))
    ->setUrl('nagvis/show/map?showMenu=1')
    ->setIcon('globe');

and

    $section->add($caption, array(
        'url'           => 'nagvis/show/map?showMenu=1',
        'urlParameters' => array('map' => $name),
        'priority'      => ++$prio
    ));
@dnsmichi dnsmichi added the bug label Aug 15, 2017
@rahonalab
Copy link

rahonalab commented Feb 1, 2018

@cflinspach workaround doesn't work on current (git) nagvis module.

fixed this by commenting out

if (checkHideMenu)
g_map.on('mousedown', checkHideMenu);
g_map.on('mousedown', context_handle_global_mousedown);

in <nagvis_webroot>/frontend/nagvis-js/js/NagVisCompressed.js

@bmccorkle
Copy link

Getting a similar error when using an interactive map...

Javascript error occured: Uncaught ReferenceError: checkHideMenu is not defined
https://icinga.domainname.com/nagvis/frontend/nagvis-js/js/ViewWorldMap.js?v=1.9.7 (80)

I used rahonalab's suggestion and commented out the following three lines at line 80 which seems to work so far

 // hide eventual open header dropdown menus when clicking on the map
if (checkHideMenu)
   g_map.on('mousedown', checkHideMenu);
g_map.on('mousedown', context_handle_global_mousedown);

icingaweb2-module-nagvis 1.1.1
nagvis 1.9.7

@wernerfred
Copy link

Figured out the same solution, damn that i didn't found this issue here, would have saved a lot of time -.-
I described the problem and my solution here: NagVis/nagvis#162

I think it's important to mention that changing something in NagVisCompressed.js did not show any effect. Therefore i deleted this file and the Error message changed from NagVisCompressed.js to ViewWorldmap.js as mentioned by @bmccorkle.
I then simply deleted the lines 80 to 83 and the error message was completely gone and not only that another problem (infinite loading at top till any action with mouse) was also solved (mentioned here: NagVis/nagvis#160)

I also did not run in other problems or could figure out any functionality which could be broken through my changes. If someone could proof that i would send a pull request :)

@LarsMichelsen
Copy link

LarsMichelsen commented Sep 7, 2018

Fixed with NagVis/nagvis@a55d9d4

@lippserd lippserd closed this as completed Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants