Window
Non-modal windows and modal dialogs. Non-modal windows (default) are draggable and stack with z-index management. Modal windows show an overlay and block page interaction.
Non-Modal Window (Default)
Non-modal windows are draggable by default, have no overlay, and re-order to front when clicked.
This is a non-modal window (default behavior).
You can drag it, click other windows to bring them to front, and interact with the page beneath.
This is another non-modal window.
Open both, drag them around, and click each one to see z-index stacking in action.
Modal Window
Modal windows show an overlay, block interaction with the page, and are not draggable.
This is a modal window. Click the X or press Escape to close.
The overlay prevents interaction with the page beneath, and modal windows cannot be dragged.
Draggable Modal (Override)
You can explicitly make a modal draggable with ->draggable().
This modal has been made draggable via ->modal()->draggable().
Drag the title bar to move this window around.
Content via JavaScript
Loading…
PHP PHP Methods (Fluent)
| Method / Property | Parameters | Description |
|---|---|---|
$m->window($id, $title) | string, string | Create a window component (non-modal by default). |
->title($title) | string | Set the window title. |
->content($html) | string | Set body HTML content. |
->modal($isModal) | bool | Make window modal with overlay (default: false). Modals block interaction and are not draggable unless ->draggable() is called. |
->draggable($drag) | bool | Allow dragging by title bar. Default: true for non-modal windows, false for modals. |
->resizable($resize) | bool | Allow window resizing. |
->scrollable($scroll) | bool | Enable content area scrolling (default: true). |
->width($w) | string | Window width (CSS value, e.g. 500px). |
->height($h) | string | Window height. |
->minWidth($w) | string | Minimum width. |
->minHeight($h) | string | Minimum height. |
->addButton($text, $action, $style) | string, string, string | Add a footer button. Style: primary, secondary, danger. |
->visible($vis) | bool | Show the window on page load. |
JS JS Methods
| Method / Property | Parameters | Description |
|---|---|---|
m.window(id, opts) | string, ?object | Get or create Window instance. |
open() | | Show the window. |
close() | | Hide the window. |
toggle() | | Toggle visibility. |
setTitle(html) | string | Update the title bar. |
setContent(html) | string | Replace body content. |
loadContent(url, fetchOpts) | string, ?object | Fetch HTML from a URL and set as content (returns Promise). |
EVENT Events
| Event Name | Detail | Description |
|---|---|---|
m:window:open | | Fired when the window opens. |
m:window:close | | Fired when the window closes. |
m:window:action | {action} | Fired when a footer button is clicked. |
m:window:content-loaded | {url} | Fired after loadContent() completes. |