# j-FloatingBox

> j-FloatingBox: obsługuje ciemny tryb

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: pl
Content-SHA256: 594b024087bf16ac51f015104d1bb20ac9033ad6bc865bb9bd700f4abd5ac37b
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- Wsparcie - mody ciemne

__Konfiguracja__:

- `zindex {Number}` standardowy indeks z dla formularzy (default: `10`)

__Metody__:

- `component.show(opt)` pokazuje pudełko
	- `opt.id {String}` _ wymagane_ - identyfikator pudełka
	- `opt.element {HTML Element}` _ wymagane_ - element docelowy
		- Możesz użyć absolutnej pozycji:
		- `opt.x {Number}`
		- `opt.y {Number}`
	- `opt.offsetX {Number}` wpływa na offset X
	- `opt.offsetY {Number}` wpływa na offset Y
	- `opt.align {String}` align `left` (default), `center` lub `right`
	- `opt.position {String}` align `top` (podstawowe), `bottom`
	- `opt.minwidth {Number}`
	- `opt.maxwidth {Number}`
	- `opt.mouseleave {String}` jest linkem do metody, wykonuje się, gdy kursor myszy opuszcza pudełko `function(e, close)}`
	- `opt.autofocus {Boolean}` próbuje skupić się na pierwszym wejściu / teksturze
	- `opt.hide {String}` - link do metody `function(box_element)`
	- `opt.show {String}` - link do metody `function(box_element)`
	- `opt.autohide {Boolean}` umożliwia ukrywanie pudełka po kliknięciu na niego
	- `opt.delay {Number}` - prosty opóźnienie w renderowaniu (default: `0`)
	- `opt.scrolltop {Boolean}` odciąga pozycję górną z bieżącego offset Y (default: `false`)
	- `opt.url {String}` opcjonalny, adres URL dla treści
		- `opt.path {String}` zastąpi wszystkie frazy `~PATH~` w pobranym szablonie
		- `opt.ID {String}` zastąpi wszystkie frazy `~ID~` w pobranym szablonie
- `component.hide()` ukrywa ostatnią otwartą skrzynkę
- `component.hide([box_id])` ukrywa konkretną skrzynkę i wszystkie jej pudełka
- `component.hide(true)` ukrywa wszystkie pudełka

### Pudełko

```html
<div class="floatingbox" data-id="yourid" data-config="">
	Your content
</div>
```

__Konfiguracja__:

- `init {String}` jest linkem do metody, wykonuje się, gdy pudełko jest inicjalizowane po raz pierwszy `function(element)`
- `reload {String}` - link do metody `function(element)`
- `hide {String}` jest linkem do metody, wykonuje się, gdy pudełko będzie ukrywać `function(element)`
- `scope {String}` - nazwa obsługi / wtyczki
- `zindex {Number}` jest indeksem z dla tej skrzynki

Użyj go z `<ui-component name="floatingbox">`Gdy element nie jest jeszcze ładowany, jComponent Pobierz go po pierwszym użyciu z adresu `DEF.fallback` (Wydaje się Componentator Autor: Peter Širka Źródło: Componentator Zestaw składników, licencja MIT.

```html example.html
<ui-component name="exec"></ui-component>
<ui-component name="floatingbox" config="zindex:10"></ui-component>

<!-- Form templates -->

<div class="floatingbox" data-id="1" style="width:200px">
	<div class="padding">
		<div>Box 1</div>
		<br />
		<br />
		<br />
	</div>
</div>

<div class="floatingbox" data-id="2" data-config="init:box2init">
	<div class="padding">
		<div>Box 2</div>
		<br />
		<br />
		<br />
		<span class="exec" data-exec="showbox" data-id="3" style="color:#2A6CEC;cursor:pointer;text-decoration:underline">Show box 3</span>
	</div>
</div>

<div class="floatingbox" data-id="3">
	<div class="padding">
		Box 3
	</div>
</div>

<!-- Executors -->

<div class="row">
	<div class="col-xs-4">
		<span class="exec" data-exec="showbox" data-id="1" style="color:#2A6CEC;cursor:pointer;text-decoration:underline" class="block">Show box 1</span>
	</div>
	<div class="col-xs-4">
		<span class="exec" data-exec="showbox" data-id="2" style="color:#2A6CEC;cursor:pointer;text-decoration:underline" class="block">Show box 2</span>
	</div>
	<div class="col-xs-4">
		<span class="exec" data-exec="showbox" data-id="3" style="color:#2A6CEC;cursor:pointer;text-decoration:underline" class="block">Show box 3</span>
	</div>
</div>

<script>

	function showbox(el) {
		var opt = {};
		opt.element = el;
		opt.id = el.attrd('id');
		SETTER('floatingbox/show', opt);
	}

	function box2init(el) {
		console.log('Box 2 is initialized', el);
	}

</script>
```
