You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a follow-up to PR #688. Several improvements and refactoring opportunities have been identified:
The closeButtonHandler and addNavigationHandlers can be generalized, so event handlers aren't re-added on every render. Check out $(parent).on("click", targetID, function(){})
The floorplan overlay should close when the ESC key is pressed.
Implement a utility method to unbind all event listeners and destroy Netjsongraph.js objects when closing the floorplan overlay.
Fix the showing and hiding logic for the floorplan spinner.
Refactor the code for managing popups use JS to get the currentPopup instead of using global variable:
Refactoring: There is reusable code inside the openFloorPlan function. Make this function leaner. Also, global variables (e.g., allResults) should be scoped inside openFloorPlan.
Investigate removing the sleep by using timeout in self.wait_for_* methods.
Do not add search.svg to openwisp-controller; Django admin already provides a search icon via static files. Investigate how to we can provide the static() URL to the CSS. Maybe, move this CSS to the template.
Add comments to the fetchDevices function in device-map.js.
Add a spinner for infinite scroll in the device list inside device-map.js.
Find better solution for handling the height of the popup, perhaps we can center the pop up to the map after the content in is reloaded due to having clicked on any filter or search?
We can avoid showing the search input if there is less than 4 devices in the location
We can avoid showing filters if there's less than 4 devices in the location
The floorplan overlay is not rendered if a user is using browser's forward and back (history buttons) to go through previous locations.
Remove hardcoded url from location-inline.js inside openIndoorDeviceBtn href
Find a way to handle event listeners for popstate and hashchange to be handled from netjsongraph.js
This issue is a follow-up to PR #688. Several improvements and refactoring opportunities have been identified:
closeButtonHandlerandaddNavigationHandlerscan be generalized, so event handlers aren't re-added on every render. Check out$(parent).on("click", targetID, function(){})currentPopupinstead of using global variable:openFloorPlanfunction. Make this function leaner. Also, global variables (e.g.,allResults) should be scoped insideopenFloorPlan.self.wait_for_*methods.search.svgto openwisp-controller; Django admin already provides a search icon via static files. Investigate how to we can provide the static() URL to the CSS. Maybe, move this CSS to the template.fetchDevicesfunction indevice-map.js.device-map.js.openIndoorDeviceBtnhrefpopstateandhashchangeto be handled from netjsongraph.jsRelated to #662
Related to #688