File Selection

Summary

The file selection pattern utilizes a dialog which loads files via AJAX which the user can choose from.

There are no attributes defined for this pattern.

Example

Select File

Markup

<div class="zui-file-selection-trigger-container" data-zui-file-selection-trigger="#file-selection-dialog">
    <input type="hidden" value="">

    <p>
        <img src="img/avatars/a.jpg" alt="" tabindex="1" class="zui-file-selection-trigger-thumb">
    </p>
</div>

<div class="zui-file-selection zui-dialog zui-dialog-small" id="file-selection-dialog">
    <div class="zui-dialog-header">
        <h2>Select File</h2>
        <i class="zui-icon zui-icon-x"></i>
    </div>

    <div class="zui-dialog-page">
        <div class="zui-dialog-page-body">
            <div class="zui-dialog-panel zui-dialog-panel-no-padding">
                <ul class="zui-file-selection-items">
                    <li title="Select this file">
                        <button tabindex="1" data-zui-file-selection-id="111" data-zui-file-selection-preview="img/avatars/a.jpg">
                            <img src="img/avatars/a.jpg" alt="Select this file">
                        </button>
                    </li>
                    <li title="Select this file">
                        <button tabindex="1" data-zui-file-selection-id="222" data-zui-file-selection-preview="img/avatars/b.jpg">
                            <img src="img/avatars/b.jpg" alt="Select this file">
                        </button>
                    </li>
                    <li title="Select this file">
                        <button tabindex="1" data-zui-file-selection-id="333" data-zui-file-selection-preview="img/avatars/c.jpg">
                            <img src="img/avatars/c.jpg" alt="Select this file">
                        </button>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <div class="zui-dialog-footer">
        <div class="zui-dialog-footer-left">
            <div class="zui-dialog-hint">
                Click on the thumbnail to select the file.
            </div>
        </div>

        <div class="zui-dialog-footer-right">
            <a href="#" data-zui-dialog-button="cancel">Cancel</a>
        </div>
    </div>
</div>
Fork me on GitHub