geniv/nette-overlay

Overlay component for Nette Framework

v2.1.2 2018-12-17 16:27 UTC

This package is auto-updated.

Last update: 2024-11-18 06:40:03 UTC


README

Installation

$ composer require geniv/nette-overlay

or

"geniv/nette-overlay": "^2.0"

require:

"php": ">=7.0",
"nette/nette": ">=2.4",
"geniv/nette-general-form": ">=1.0"

Include in application

neon configure:

services:
    - Overlay

usage:

protected function createComponentOverlay(Overlay $overlay): Overlay
{
    //$overlay->setTemplatePath(__DIR__.'/templates/overlayBegin.latte');
    //$overlay->setTemplatePathBoth(__DIR__.'/templates/overlayBegin.latte',__DIR__.'/templates/overlayEnd.latte');
    return $overlay;
}

usage:

data-specific in href custom-layer-1 correspond name by in {control overlay:begin ...

<a href="#" class="nette-overlay__open" data-specific="custom-layer-1" data-body-padding-fix="true" data-body-overflow-fix="true">Open custom layer #1</a>
...
{control overlay:begin 'custom-layer-1'}
or
{control overlay:begin 'custom-layer-1', 'class-modifier'}
content
{control overlay:end}

or extreme usage, better usage is: Multiplier

protected function createComponentOverlay1(Overlay $overlay): Overlay
{
    $overlay = clone $overlay;
    //$overlay->setTemplatePath(__DIR__.'/templates/overlayBegin.latte');
    return $overlay;
}

and latte:

{control overlay1:begin 'custom-layer-2'}form{control overlay1:end}

JS:

netteOverlayOpen([specificNetteOverlay, firstFocus, bodyOverflowFix, bodyPaddingFix]);
netteOverlayClose();