mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-18 21:05:57 +00:00
c6a502954d
The behavior of the cog varies when: * The user is logged in/out. * Page Previews is enabled as a beta feature. Since the behavior of the cog doesn't vary per-preview, it can be determined at boot time and passed to the renderer. However, in order to keep the renderer stateless, we pass the behavior to it when a preview is added to the DOM. Changes: * Add the mw.popups.createPreviewBehavior factory function, which returns an object that encapsulates how a preview responds to the user dwelling on it, abandoning it, and clicking on the cog. * Invoke mw.popups.createPreviewBehavior at boot time and pass it to the mw.popups.changeListeners.render change listener, which then passes it to mw.popups.Preview#show. * Make mw.popups.Preview#show responsible for binding event handlers and configuring the cog based on the behavior. Bug: T146889 Change-Id: I39d7d0afd7b1fe896019a1b3a82ee907bfb20edd |
||
---|---|---|
.. | ||
ext.popups | ||
ext.popups.core.test.js | ||
ext.popups.desktopRenderer.test.js | ||
ext.popups.renderer.article.test.js | ||
ext.popups.schemaPopups.utils.test.js |