Codeinwp / themeisle-companion

Orbit Fox Companion
GNU General Public License v2.0
13 stars 18 forks source link

Menu Icon Issues #121

Closed abaicus closed 6 years ago

abaicus commented 6 years ago

When you have a lot of menu items, the menus dashboard page freezes the browser.

This is probably because of the multiple iconpickers and because they parse the icons array dinamically.

When adding a new element to the menu, there are two add icon buttons.

image

The two buttons appear on the top menu item.

When the menu contains invalid menu items (pages / posts that have been deleted), sometimes it throws a js error.

Uncaught TypeError: Cannot read property 'match' of undefined
    at get_prefix (admin.js:18)
    at add_icon (admin.js:51)
    at HTMLLIElement.<anonymous> (admin.js:34)
    at Function.each (load-scripts.php:2)
    at a.fn.init.each (load-scripts.php:2)
    at admin.js:31
    at Array.forEach (<anonymous>)
    at MutationObserver.<anonymous> (admin.js:30)
contactashish13 commented 6 years ago

@abaicus

When you have a lot of menu items, the menus dashboard page freezes the browser.

does this freeze on page load or when you try to select an icon?

When adding a new element to the menu, there are two add icon buttons.

when adding a new element, its usually added at the bottom but in the issue it seems like its being added at the top. I cannot seem to reproduce the issue; maybe it is a specific scenario?

abaicus commented 6 years ago

@contactashish13

  1. It freezes on page load, can't do anything else.
  2. It seems to only happen from time to time, not always. I can't really reproduce it either at the moment.

LATER EDIT: The new element is added at the bottom but the first element gets another iconpicker from what I remember.

contactashish13 commented 6 years ago

@abaicus

When the menu contains invalid menu items (pages / posts that have been deleted), sometimes it throws a js error.

can you please list down the steps to reproduce this? for me, this is what it shows after I delete a post that was added to the menu (and no JS error):

image

abaicus commented 6 years ago

Try adding a lot of menu items in the menu - also submenus. I'm talking about a lot more menu items.

Can't get the second js error to come up either. I don't know why.

selul commented 6 years ago

@contactashish13 please have a look at that HS ticket that andrei assigned to you.

contactashish13 commented 6 years ago

@selul @abaicus https://github.com/Codeinwp/themeisle-companion/pull/134 should fix these issues. Can you please test locally in case I've forgotten to test a scenario and then I can apply this on the customer's instance?

selul commented 6 years ago

@abaicus did you manage to test it ?

abaicus commented 6 years ago

@contactashish13 This happens when you drag and drop any menu item on my instance. Another plus appears.

image

contactashish13 commented 6 years ago

@abaicus have addressed this. can you please test again?

abaicus commented 6 years ago

image Still getting this when trying to move anything. Loading seems to be improved though. 👍 @contactashish13

contactashish13 commented 6 years ago

@abaicus can you try to clear your cache and test as most of these changes are in the JS file?

abaicus commented 6 years ago

My cache is cleared. Also happens under Safari and Firefox, which are browsers from where I've never accessed this.

image image

contactashish13 commented 6 years ago

@abaicus I didn't notice the error before. I've addressed it now.

abaicus commented 6 years ago

Seems to be working fine now! 👍