# Popups Displays a modal popup, based on the Bootstrap modal implementation. - [Examples](#examples) - [Inline popups](#inline-popups) - [Remote popups](#remote-popups) - [API documentation](#api-docs) ## Examples Launch basic content Launch Confirmation dialog ## Inline popups An inline popup places the popup content inside the current page, hidden from the view. For example, this container will not be visible on the page. ```html ``` Use the `data-toggle="modal"` HTML attribute to launch this container as a popup. ```html Launch basic content ``` ## Remote popups Content for the popup can be loaded remotely using an AJAX request. Use the `data-handler` attribute to populate a popup with the contents of an AJAX handler. ```html Launch Ajax Form ``` Using the `data-ajax` attribute you can refer to an external file or URL directly. ```html Launch Ajax Form ``` The partial for your rendered popup should follow this structure: ```html ``` ## API documentation ### Options: - `content` - content HTML string or callback ### Data attributes - `data-control="popup"` - enables the ajax popup plugin - `data-ajax="popup-content.htm"` - ajax content to load - `data-handler="onLoadContent"` - Winter ajax request name - `data-keyboard="false"` - Allow popup to be closed with the keyboard - `data-extra-data="file_id: 1"` - Winter ajax request data - `data-size="large"` - Popup size, available sizes: `giant`, `huge`, `large`, `small`, `tiny`, `adaptive` (will scale to fit the window) - `data-adaptive-height="false"` - Allow the popup to fill the height of the screen ### JavaScript API ```js $('a#someLink').popup({ ajax: 'popup-content.htm' }) $('a#someLink').popup({ handler: 'onLoadSomePopup' }) $('a#someLink').popup({ handler: 'onLoadSomePopup', extraData: { id: 3 } }) ```