mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 04:36:11 +08:00

We had code to open the bookmark modal in two places -- the bookmark list and also from within a topic. This caused the two code paths to drift, as in the bookmark list we were not passing in the forTopic or autoDeletePreferences data into the modal, and we were also not refreshing the bookmark list when the bookmark was deleted from within the modal. This commit moves the modal opening code into an importable function from the controllers/bookmark module, and all callers have to do is pass it an instance of Bookmark and also options for what to do for the following: * onAfterSave * onAfterDelete * onCloseWithoutSaving