-
Notifications
You must be signed in to change notification settings - Fork 14
Frontend Development Notes
Used library: https://github.com/pimterry/loglevel
To activate logging, execute log.enableAll() in the console (logging level is saved in LocalStorage). To keep the logging output clear, prefix all debug messages with the behaviour name in all-caps. Only leave logging messages in the commits if they are needed for clarification of what is going on in the long term. Use log.debug() for longterm logging.
When content is shown in a modal, behaviours are attached afterwards for three reasons:
- order of attachment doesn't matter this way
(otherwise if app attachment happens before others, the markup misses the rest) - better performance when content isn't send to modal on load
- some behaviours might need the elements to be visible
10.10.2016 Moving away from planed attribute logic with [data-attache~="foo"] [data-behaviour~="foo"], that was introduced with form widgets to keep them from being attached before forms are moved to modal. Therefore introduced a general [data-dont-behave] attribute to leave out markup during attaching. This is easier to implement completely because less markup needs to be touched.
For now realized this along to the solution described here: https://github.com/twitter/typeahead.js/issues/271#issuecomment-121720571 ... which is till lacking of corresponding highlighting. There are some issues/discussions inside the official typeahead repo and corresponding forks:
Tried the latest version of wakingrufus, without success.
7.12.2016
For now it's activated by default. To avoid narrowing on single resource click, the zoom to highlighted pins was deactivated in case of a visible index column. An alternative would be to deactivate "Search as I move the map" by default and activate it on cluster click. Afterwards it will stay active until the next reload of the index column. To deactivate it on single resource click would be confusing, as the list would become longer then.
It turns out this is not sufficient: the maps layout function after paging causes the map extent being reset to the complete result and there is no reliable way to set the map extent so that the list stays unchanged after a third column appears. This will be fixed by two modifications:
- The map's
restrictListToExtent()will only sort out the list, if the maps resolution or center change was caused by mouse interaction. - When index column isn't reloaded, map doesn't get refocussed.