733 lines
23 KiB
HTML
733 lines
23 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<title>JSDoc: Global</title>
|
||
|
||
<script src="scripts/prettify/prettify.js"></script>
|
||
<script src="scripts/prettify/lang-css.js"></script>
|
||
<!--[if lt IE 9]>
|
||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||
<![endif]-->
|
||
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css" />
|
||
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css" />
|
||
</head>
|
||
|
||
<body>
|
||
<div id="main">
|
||
<h1 class="page-title">Global</h1>
|
||
|
||
<section>
|
||
<header>
|
||
<h2></h2>
|
||
</header>
|
||
|
||
<article>
|
||
<div class="container-overview">
|
||
<dl class="details"></dl>
|
||
</div>
|
||
|
||
<h3 class="subsection-title">Members</h3>
|
||
|
||
<h4 class="name" id="init">
|
||
<span class="type-signature">(protected) </span>#init<span
|
||
class="type-signature"
|
||
></span>
|
||
</h4>
|
||
|
||
<div class="description">
|
||
Приватный метод. Общая инициализация селекта. Получение настоек и преобразвание
|
||
элементов селекта.
|
||
</div>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line232">line 232</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h5>Example</h5>
|
||
|
||
<pre class="prettyprint"><code>{
|
||
selector: '.cg-dropdown_one',
|
||
placeholder: 'Выберите авто',
|
||
items: [
|
||
'BMW',
|
||
{
|
||
id: '213sade',
|
||
title: 'Opel',
|
||
value: 1,
|
||
},
|
||
'Mersedes',
|
||
'MAN',
|
||
'max',
|
||
],
|
||
multiselect: true,
|
||
multiselectTag: true,
|
||
}</code></pre>
|
||
|
||
<h3 class="subsection-title">Methods</h3>
|
||
|
||
<h4 class="name" id="addOptionsBehaviour">
|
||
<span class="type-signature">(protected) </span>#addOptionsBehaviour<span
|
||
class="signature"
|
||
>()</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">
|
||
Метод реализовывающий выбор элементов в разных режимах.
|
||
Обычный/Мультиселект/Мультиселект + Мультиселект Таг.
|
||
</div>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line480">line 480</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="close">
|
||
<span class="type-signature">(protected) </span>#close<span class="signature">()</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">Закрывает список</div>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line469">line 469</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="initEvent">
|
||
<span class="type-signature">(protected) </span>#initEvent<span class="signature"
|
||
>()</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">Открывает и закрывает список по переданному эвенту</div>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line575">line 575</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="initSelected">
|
||
<span class="type-signature">(protected) </span>#initSelected<span class="signature"
|
||
>(select)</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">Отрисовывает и стилизует селект</div>
|
||
|
||
<h5>Parameters:</h5>
|
||
|
||
<table class="params">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
|
||
<th>Type</th>
|
||
|
||
<th class="last">Description</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr>
|
||
<td class="name"><code>select</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">string</span>
|
||
</td>
|
||
|
||
<td class="description last">
|
||
необязательный елемент. Используется в методе selectIndex
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line299">line 299</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="open">
|
||
<span class="type-signature">(protected) </span>#open<span class="signature"
|
||
>(oneClick)</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">Открывает список для выбора элемента</div>
|
||
|
||
<h5>Parameters:</h5>
|
||
|
||
<table class="params">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
|
||
<th>Type</th>
|
||
|
||
<th class="last">Description</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr>
|
||
<td class="name"><code>oneClick</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">boolean</span>
|
||
</td>
|
||
|
||
<td class="description last">
|
||
необязательный параметр передаваемый из функции buttonControl
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line449">line 449</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="render">
|
||
<span class="type-signature">(protected) </span>#render<span class="signature"
|
||
>(select)</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">Рендер елементов в селекте.</div>
|
||
|
||
<h5>Parameters:</h5>
|
||
|
||
<table class="params">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
|
||
<th>Type</th>
|
||
|
||
<th class="last">Description</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr>
|
||
<td class="name"><code>select</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">string</span>
|
||
</td>
|
||
|
||
<td class="description last">
|
||
необязательный елемент. Передаеться в метод initSelected
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line327">line 327</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="renderUrl">
|
||
<span class="type-signature">(protected) </span>#renderUrl<span class="signature"
|
||
>()</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">Рендер елементов в селекте переданных с URL и их настойка</div>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line393">line 393</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="searchMode">
|
||
<span class="type-signature">(protected) </span>#searchMode<span class="signature"
|
||
>(random)</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">Метод который реализует поиск элементов в селекте</div>
|
||
|
||
<h5>Parameters:</h5>
|
||
|
||
<table class="params">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
|
||
<th>Type</th>
|
||
|
||
<th class="last">Description</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr>
|
||
<td class="name"><code>random</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">string</span>
|
||
</td>
|
||
|
||
<td class="description last">уникальное значение для input элемента.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line617">line 617</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="addItem">
|
||
<span class="type-signature"></span>addItem<span class="signature">(item)</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">
|
||
добавляет переданный элемент в конец списка и перерисовывает список. Не может
|
||
использоваться при передачи элементов с категорями
|
||
</div>
|
||
|
||
<h5>Parameters:</h5>
|
||
|
||
<table class="params">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
|
||
<th>Type</th>
|
||
|
||
<th class="last">Description</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr>
|
||
<td class="name"><code>item</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">string</span>
|
||
|
|
||
|
||
<span class="param-type">object</span>
|
||
</td>
|
||
|
||
<td class="description last">добавляемый елемент</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line107">line 107</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="buttonControl">
|
||
<span class="type-signature"></span>buttonControl<span class="signature"
|
||
>(button, method)</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">
|
||
Метод позволяющий открывать/закрывать селект с помощью кнопок
|
||
</div>
|
||
|
||
<h5>Parameters:</h5>
|
||
|
||
<table class="params">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
|
||
<th>Type</th>
|
||
|
||
<th class="last">Description</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr>
|
||
<td class="name"><code>button</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">HTMLInputElement</span>
|
||
</td>
|
||
|
||
<td class="description last">HTML кнопка</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td class="name"><code>method</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">string</span>
|
||
</td>
|
||
|
||
<td class="description last">метод открытия open/close</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line213">line 213</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="deleteItem">
|
||
<span class="type-signature"></span>deleteItem<span class="signature">(index)</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">
|
||
удаляет елемент по индексу из списка и перерисовывает его. Не может использоваться при
|
||
передачи элементов с категорями.
|
||
</div>
|
||
|
||
<h5>Parameters:</h5>
|
||
|
||
<table class="params">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
|
||
<th>Type</th>
|
||
|
||
<th class="last">Description</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr>
|
||
<td class="name"><code>index</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">number</span>
|
||
</td>
|
||
|
||
<td class="description last">индекс удаляемого элемента</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line129">line 129</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="deleteItemAll">
|
||
<span class="type-signature"></span>deleteItemAll<span class="signature">()</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">удаляет все елементы из списка и перерисовывает его.</div>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line147">line 147</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="disabled">
|
||
<span class="type-signature"></span>disabled<span class="signature">(value)</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">Метод позволяющий переключать состояние селекта disabled,</div>
|
||
|
||
<h5>Parameters:</h5>
|
||
|
||
<table class="params">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
|
||
<th>Type</th>
|
||
|
||
<th class="last">Description</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr>
|
||
<td class="name"><code>value</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">boolean</span>
|
||
</td>
|
||
|
||
<td class="description last">
|
||
Передаваемый параметр для добавления атрибута disabled;
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line192">line 192</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="getElement">
|
||
<span class="type-signature"></span>getElement<span class="signature">(numberItem)</span
|
||
><span class="type-signature"> → {HTMLElement}</span>
|
||
</h4>
|
||
|
||
<div class="description">Метод экземпляра класса DropDown</div>
|
||
|
||
<h5>Parameters:</h5>
|
||
|
||
<table class="params">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
|
||
<th>Type</th>
|
||
|
||
<th class="last">Description</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr>
|
||
<td class="name"><code>numberItem</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">number</span>
|
||
</td>
|
||
|
||
<td class="description last">номер возвращаемого элемента</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line179">line 179</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h5>Returns:</h5>
|
||
|
||
<div class="param-desc">возвращает ссылку на выбранный HTML элемент</div>
|
||
|
||
<dl>
|
||
<dt>Type</dt>
|
||
<dd>
|
||
<span class="param-type">HTMLElement</span>
|
||
</dd>
|
||
</dl>
|
||
|
||
<h4 class="name" id="selectIndex">
|
||
<span class="type-signature"></span>selectIndex<span class="signature">(index)</span
|
||
><span class="type-signature"></span>
|
||
</h4>
|
||
|
||
<div class="description">
|
||
выбирает элемент который будет изначально отрисовываться в селекте
|
||
</div>
|
||
|
||
<h5>Parameters:</h5>
|
||
|
||
<table class="params">
|
||
<thead>
|
||
<tr>
|
||
<th>Name</th>
|
||
|
||
<th>Type</th>
|
||
|
||
<th class="last">Description</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody>
|
||
<tr>
|
||
<td class="name"><code>index</code></td>
|
||
|
||
<td class="type">
|
||
<span class="param-type">number</span>
|
||
</td>
|
||
|
||
<td class="description last">индекс выбранного элемента</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
<dl class="details">
|
||
<dt class="tag-source">Source:</dt>
|
||
<dd class="tag-source">
|
||
<ul class="dummy">
|
||
<li>
|
||
<a href="cg-dropdown.js.html">cg-dropdown.js</a>,
|
||
<a href="cg-dropdown.js.html#line157">line 157</a>
|
||
</li>
|
||
</ul>
|
||
</dd>
|
||
</dl>
|
||
</article>
|
||
</section>
|
||
</div>
|
||
|
||
<nav>
|
||
<h2><a href="index.html">Home</a></h2>
|
||
<h3>Classes</h3>
|
||
<ul>
|
||
<li><a href="DropDown.html">DropDown</a></li>
|
||
<li>
|
||
<a
|
||
href="%25D0%259A%25D0%25BE%25D0%25BD%25D1%2581%25D1%2582%25D1%2580%25D1%2583%25D0%25BA%25D1%2582%25D0%25BE%25D1%2580%2520%25D0%25BA%25D0%25BB%25D0%25B0%25D1%2581%25D1%2581%25D0%25B0%2520DropDown.html"
|
||
>Конструктор класса DropDown</a
|
||
>
|
||
</li>
|
||
</ul>
|
||
<h3>Modules</h3>
|
||
<ul>
|
||
<li><a href="module-Utils.html">Utils</a></li>
|
||
<li><a href="module-createElementChips.html">createElementChips</a></li>
|
||
</ul>
|
||
<h3>Private methods</h3>
|
||
<ul>
|
||
<li><a href="global.html#addOptionsBehaviour">#addOptionsBehaviour</a></li>
|
||
<li><a href="global.html#close">#close</a></li>
|
||
<li><a href="global.html#init">#init</a></li>
|
||
<li><a href="global.html#initEvent">#initEvent</a></li>
|
||
<li><a href="global.html#initSelected">#initSelected</a></li>
|
||
<li><a href="global.html#open">#open</a></li>
|
||
<li><a href="global.html#render">#render</a></li>
|
||
<li><a href="global.html#renderUrl">#renderUrl</a></li>
|
||
<li><a href="global.html#searchMode">#searchMode</a></li>
|
||
</ul>
|
||
<h3>Public methods</h3>
|
||
<ul>
|
||
<li><a href="global.html#addItem">addItem</a></li>
|
||
<li><a href="global.html#buttonControl">buttonControl</a></li>
|
||
<li><a href="global.html#deleteItem">deleteItem</a></li>
|
||
<li><a href="global.html#deleteItemAll">deleteItemAll</a></li>
|
||
<li><a href="global.html#disabled">disabled</a></li>
|
||
<li><a href="global.html#getElement">getElement</a></li>
|
||
<li><a href="global.html#selectIndex">selectIndex</a></li>
|
||
</ul>
|
||
</nav>
|
||
|
||
<br class="clear" />
|
||
|
||
<footer>
|
||
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.11</a> on Wed
|
||
Oct 19 2022 20:30:19 GMT+0300 (Moscow Standard Time)
|
||
</footer>
|
||
|
||
<script>
|
||
prettyPrint();
|
||
</script>
|
||
<script src="scripts/linenumber.js"></script>
|
||
</body>
|
||
</html>
|