{"id":310740,"date":"2020-09-30T15:00:55","date_gmt":"2020-09-30T15:00:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=310740"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=310740","title":{"rendered":"Drag&#8217;n&#8217;Drop API: \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/521394\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mx\/ew\/5j\/mxew5jayb_kwoxa1fe4w1sne0cw.png\"><\/p>\n<p>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0434\u0440\u0443\u0437\u044c\u044f!<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n<p>  \u0421\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u0440\u0430\u0434\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043c\u044b\u0448\u0438, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0418\u043b\u044c\u044f \u041a\u0430\u043d\u0442\u043e\u0440 \u0432 <a href=\"https:\/\/learn.javascript.ru\/mouse-drag-and-drop\" rel=\"nofollow\">\u0441\u0432\u043e\u0435\u043c \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0435<\/a>, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430, \u043e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 <a href=\"https:\/\/html.spec.whatwg.org\/multipage\/dnd.html#dnd\" rel=\"nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e<\/a>.<\/p>\n<p>  \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/f-\/2w\/rt\/f-2wrtv6rtlvnj9zbjxiuo7lv1i.png\"><\/p>\n<p>  \u041f\u0440\u0435\u0432\u044c\u044e:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nd\/ye\/iv\/ndyeivhd3l3rqaqmblhz1vva9dq.png\">  <\/p>\n<ul>\n<li><a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Web\/Guide\/HTML\/Drag_and_drop\" rel=\"nofollow\">MDN<\/a><\/li>\n<li><a href=\"https:\/\/harryheman.github.io\/drag-n-drop-example\/\" rel=\"nofollow\">\u0414\u0435\u043c\u043e<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/harryheman\/drag-n-drop-example\" rel=\"nofollow\">\u041a\u043e\u0434<\/a><\/li>\n<li><a href=\"https:\/\/codepen.io\/harryheman\/pen\/WNwBvgr\" rel=\"nofollow\">\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/li>\n<\/ul>\n<p>  \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0442\u0440\u0435\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a: \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447. \u042d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u2014 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u043f\u043e\u0434 \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u043c, \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u0433\u0434\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043d\u0430\u0434 \u0438\u043b\u0438 \u043f\u043e\u0434 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/getbootstrap.com\/\" rel=\"nofollow\">Bootstrap<\/a>.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0437\u0430 \u043c\u043d\u043e\u0439.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0420\u0430\u0437\u043c\u0435\u0442\u043a\u0430:<\/p>\n<pre><code class=\"xml\">&lt;head&gt;     &lt;!-- Bootstrap CSS --&gt;     &lt;link       rel=&quot;stylesheet&quot;       href=&quot;https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.5.2\/css\/bootstrap.min.css&quot;       integrity=&quot;sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z&quot;       crossorigin=&quot;anonymous&quot;     \/&gt;     &lt;!-- custom CSS --&gt;     &lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; \/&gt;   &lt;\/head&gt;   &lt;body class=&quot;container&quot;&gt;     &lt;h1&gt;Drag &amp; Drop Example&lt;\/h1&gt;     &lt;main class=&quot;row&quot;&gt;       &lt;div class=&quot;input-group&quot;&gt;         &lt;div class=&quot;input-group-prepend&quot;&gt;           &lt;span class=&quot;input-group-text&quot;&gt;Enter new todo: &lt;\/span&gt;         &lt;\/div&gt;         &lt;input           type=&quot;text&quot;           class=&quot;form-control&quot;           placeholder=&quot;todo4&quot;           data-name=&quot;todo-input&quot;         \/&gt;         &lt;div class=&quot;input-group-append&quot;&gt;           &lt;button class=&quot;btn btn-success&quot; data-name=&quot;add-btn&quot;&gt;Add&lt;\/button&gt;         &lt;\/div&gt;       &lt;\/div&gt;        &lt;div class=&quot;col-4&quot;&gt;         &lt;h3&gt;Todos&lt;\/h3&gt;         &lt;ul class=&quot;list-group&quot; data-name=&quot;todos-list&quot;&gt;           &lt;li class=&quot;list-group-item&quot; data-id=&quot;1&quot; draggable=&quot;true&quot;&gt;             &lt;p&gt;todo1&lt;\/p&gt;             &lt;button               class=&quot;btn btn-outline-danger btn-sm&quot;               data-name=&quot;remove-btn&quot;             &gt;               X             &lt;\/button&gt;           &lt;\/li&gt;           &lt;li class=&quot;list-group-item&quot; data-id=&quot;2&quot; draggable=&quot;true&quot;&gt;             &lt;p&gt;todo2&lt;\/p&gt;             &lt;button               class=&quot;btn btn-outline-danger btn-sm&quot;               data-name=&quot;remove-btn&quot;             &gt;               X             &lt;\/button&gt;           &lt;\/li&gt;           &lt;li class=&quot;list-group-item&quot; data-id=&quot;3&quot; draggable=&quot;true&quot;&gt;             &lt;p&gt;todo3&lt;\/p&gt;             &lt;button               class=&quot;btn btn-outline-danger btn-sm&quot;               data-name=&quot;remove-btn&quot;             &gt;               X             &lt;\/button&gt;           &lt;\/li&gt;         &lt;\/ul&gt;       &lt;\/div&gt;        &lt;div class=&quot;col-4&quot;&gt;         &lt;h3&gt;In Progress&lt;\/h3&gt;         &lt;ul class=&quot;list-group&quot; data-name=&quot;in-progress-list&quot;&gt;&lt;\/ul&gt;       &lt;\/div&gt;        &lt;div class=&quot;col-4&quot;&gt;         &lt;h3&gt;Completed&lt;\/h3&gt;         &lt;ul class=&quot;list-group&quot; data-name=&quot;completed-list&quot;&gt;&lt;\/ul&gt;       &lt;\/div&gt;     &lt;\/main&gt;      &lt;!-- custom JS --&gt;     &lt;script src=&quot;script.js&quot;&gt;&lt;\/script&gt; &lt;\/body&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u043f\u043e\u043b\u0435\u043c \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u0434\u043b\u044f \u0435\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u043f\u0438\u0441\u043e\u043a (input-group), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430-\u043a\u043e\u043b\u043e\u043d\u043a\u0438 (list-group) \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u0434\u0430\u0447 (todos-list), \u0437\u0430\u0434\u0430\u0447 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (in-progress-list) \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 (completed-list). \u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u00abdata\u00bb, \u0442\u043e \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f: \u043a\u043b\u0430\u0441\u0441\u044b \u2014 \u0434\u043b\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438, data \u2014 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0421\u0442\u0438\u043b\u0438:<\/p>\n<pre><code class=\"css\">body {   min-height: 100vh;   display: flex;   flex-direction: column;   justify-content: center;   align-items: center;   color: #222; }  main {   max-width: 600px; }  .input-group {   margin: 1rem; }  .list-group {   min-height: 100px;   height: 100%; }  .list-group-item {   display: flex;   justify-content: space-between;   align-items: center; }  div + div {   border-right: 1px dotted #222; }  h3 {   text-align: center; }  p {   margin: 0; }  .completed p {   text-decoration: line-through; }  .in-progress p {   border-bottom: 1px dashed #222; }  .drop {   background: #eee;   border-radius: 4px; }  <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441\u044b \u00abin-progress\u00bb \u0438 \u00abcompleted\u00bb \u0441\u043b\u0443\u0436\u0430\u0442 \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440\u0430\u043c\u0438 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0435. \u041a\u043b\u0430\u0441\u0441 \u00abdrop\u00bb \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0437\u043e\u043d\u0443 \u0434\u043b\u044f \u00ab\u0431\u0440\u043e\u0441\u0430\u043d\u0438\u044f\u00bb.<\/p>\n<p>  \u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0443, \u043e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u044f, \u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445.<\/p>\n<p>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439:<\/p>\n<pre><code class=\"javascript\">const main = document.querySelector(&quot;main&quot;); <\/code><\/pre>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447 \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043a\u043b\u0438\u043a\u0430:<\/p>\n<pre><code class=\"javascript\">main.addEventListener(&quot;click&quot;, (e) =&gt; {   \/\/ \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438   if (e.target.tagName === &quot;BUTTON&quot;) {     \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &quot;data-name&quot;     const { name } = e.target.dataset;     \/\/ \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u043a\u043d\u043e\u043f\u043a\u0430 \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0441\u043f\u0438\u0441\u043e\u043a     if (name === &quot;add-btn&quot;) {       \/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0438       const todoInput = main.querySelector('[data-name=&quot;todo-input&quot;]');       \/\/ \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c       if (todoInput.value.trim() !== &quot;&quot;) {         \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u0434\u0430\u0447\u0438         const value = todoInput.value;         \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0437\u0430\u0434\u0430\u0447\u0438         const template = `         &lt;li class=&quot;list-group-item&quot; draggable=&quot;true&quot; data-id=&quot;${Date.now()}&quot;&gt;           &lt;p&gt;${value}&lt;\/p&gt;           &lt;button class=&quot;btn btn-outline-danger btn-sm&quot; data-name=&quot;remove-btn&quot;&gt;X&lt;\/button&gt;         &lt;\/li&gt;         `;         \/\/ \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447         const todosList = main.querySelector('[data-name=&quot;todos-list&quot;]');         \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d \u0437\u0430\u0434\u0430\u0447\u0438         todosList.insertAdjacentHTML(&quot;beforeend&quot;, template);         \/\/ \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u043f\u043e\u043b\u0435 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0442\u0435\u043a\u0441\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0438         todoInput.value = &quot;&quot;;       }     \/\/ \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u043a\u043d\u043e\u043f\u043a\u0430 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438     } else if (name === &quot;remove-btn&quot;) {       \/\/ \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0435\u0435       e.target.parentElement.remove();     }   } }); <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u044e.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u0437\u043e\u043d\u0443 \u0434\u043b\u044f \u00ab\u0431\u0440\u043e\u0441\u0430\u043d\u0438\u0435\u00bb \u0438 \u0443\u0445\u043e\u0434 \u0438\u0437 \u043d\u0435\u0435 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<pre><code class=\"javascript\">main.addEventListener(&quot;dragenter&quot;, (e) =&gt; {   \/\/ \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043b\u043e\u043d\u043a\u0438   if (e.target.classList.contains(&quot;list-group&quot;)) {     e.target.classList.add(&quot;drop&quot;);   } });  main.addEventListener(&quot;dragleave&quot;, (e) =&gt; {   if (e.target.classList.contains(&quot;drop&quot;)) {     e.target.classList.remove(&quot;drop&quot;);   } }); <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u043e \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"javascript\">main.addEventListener(&quot;dragstart&quot;, (e) =&gt; {   \/\/ \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0430\u0447\u0430   if (e.target.classList.contains(&quot;list-group-item&quot;)) {     \/\/ \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 &quot;dataTransfer&quot; \u0432 \u0432\u0438\u0434\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430;     \/\/ dataTransfer \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c HTML - text\/html,     \/\/ \u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043c \u044d\u0442\u043e \u043d\u0438 \u043a \u0447\u0435\u043c\u0443     e.dataTransfer.setData(&quot;text\/plain&quot;, e.target.dataset.id);   } }); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u043f\u043e\u0434 \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u043c. \u042d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435, \u0442.\u0435. \u043c\u0435\u043d\u044f\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435 \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u041f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u00abmousemove\u00bb \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 \u00abelementFromPoint(x, y)\u00bb. \u041f\u0440\u0435\u043b\u0435\u0441\u0442\u044c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u00ab\u043d\u0438\u0437\u043b\u0435\u0436\u0430\u0449\u0435\u0433\u043e\u00bb \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u00abdragover\u00bb:<\/p>\n<pre><code class=\"javascript\">\/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f &quot;\u043d\u0438\u0437\u043b\u0435\u0436\u0430\u0449\u0435\u0433\u043e&quot; \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 let elemBelow = &quot;&quot;;  main.addEventListener(&quot;dragover&quot;, (e) =&gt; {   \/\/ \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430;   \/\/ \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435   e.preventDefault();    \/\/ \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442;   \/\/ \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0437\u0436\u0435   elemBelow = e.target; }); <\/code><\/pre>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u00abdrop\u00bb (\u00ab\u0431\u0440\u043e\u0441\u0430\u043d\u0438\u0435\u00bb):<\/p>\n<pre><code class=\"javascript\">main.addEventListener(&quot;drop&quot;, (e) =&gt; {   \/\/ \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 dataTransfer   const todo = main.querySelector(     `[data-id=&quot;${e.dataTransfer.getData(&quot;text\/plain&quot;)}&quot;]`   );    \/\/ \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0430 \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 - \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435   if (elemBelow === todo) {     return;   }    \/\/ \u0435\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u0433\u0440\u0430\u0444 \u0438\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0430, \u0437\u043d\u0430\u0447\u0438\u0442, \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0438\u0445 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442   if (elemBelow.tagName === &quot;P&quot; || elemBelow.tagName === &quot;BUTTON&quot;) {     elemBelow = elemBelow.parentElement;   }    \/\/ \u043d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u0437\u0430\u0434\u0430\u0447\u0435\u0439   if (elemBelow.classList.contains(&quot;list-group-item&quot;)) {     \/\/ \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0443\u0434\u0430 \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442:     \/\/ \u0434\u043e \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u043d\u0438\u0437\u043b\u0435\u0436\u0430\u0449\u0435\u0433\u043e;     \/\/ \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0446\u0435\u043d\u0442\u0440 \u043d\u0438\u0437\u043b\u0435\u0436\u0430\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430     \/\/ \u0438 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0443\u0440\u0441\u043e\u0440\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u0446\u0435\u043d\u0442\u0440\u0430 (\u0432\u044b\u0448\u0435 \u0438\u043b\u0438 \u043d\u0438\u0436\u0435)     \/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0446\u0435\u043d\u0442\u0440     const center =       elemBelow.getBoundingClientRect().y +       elemBelow.getBoundingClientRect().height \/ 2;     \/\/ \u0435\u0441\u043b\u0438 \u043a\u0443\u0440\u0441\u043e\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0438\u0436\u0435 \u0446\u0435\u043d\u0442\u0440\u0430     \/\/ \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u043e\u043c\u0435\u0449\u0435\u043d \u043f\u043e\u0434 \u043d\u0438\u0437\u043b\u0435\u0436\u0430\u0449\u0438\u043c     \/\/ \u0438\u043d\u0430\u0447\u0435, \u043f\u0435\u0440\u0435\u0434 \u043d\u0438\u043c     if (e.clientY &gt; center) {       if (elemBelow.nextElementSibling !== null) {         elemBelow = elemBelow.nextElementSibling;       } else {         return;       }     }      elemBelow.parentElement.insertBefore(todo, elemBelow);     \/\/ \u0440\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u0445     \/\/ \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u043c\u0438     todo.className = elemBelow.className;   }    \/\/ \u0435\u0441\u043b\u0438 \u0446\u0435\u043b\u044c\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0430   if (e.target.classList.contains(&quot;list-group&quot;)) {     \/\/ \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0435 \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442     \/\/ \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438\u0437 &quot;\u0440\u043e\u0434\u043d\u043e\u0439&quot; \u043a\u043e\u043b\u043e\u043d\u043a\u0438     e.target.append(todo);      \/\/ \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u043e\u043d\u044b \u0434\u043b\u044f &quot;\u0431\u0440\u043e\u0441\u0430\u043d\u0438\u044f&quot;     if (e.target.classList.contains(&quot;drop&quot;)) {       e.target.classList.remove(&quot;drop&quot;);     }      \/\/ \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043b\u043e\u043d\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f     const { name } = e.target.dataset;      if (name === &quot;completed-list&quot;) {       if (todo.classList.contains(&quot;in-progress&quot;)) {         todo.classList.remove(&quot;in-progress&quot;);       }       todo.classList.add(&quot;completed&quot;);     } else if (name === &quot;in-progress-list&quot;) {       if (todo.classList.contains(&quot;completed&quot;)) {         todo.classList.remove(&quot;completed&quot;);       }       todo.classList.add(&quot;in-progress&quot;);     } else {       todo.className = &quot;list-group-item&quot;;     }   } }); <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e. \u0417\u0430\u0442\u043e \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0434\u0430\u043d\u043d\u0443\u044e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e, \u0438 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u043c \u0441\u0447\u0430\u0441\u0442\u044c\u0435.<\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0432\u044b \u043d\u0430\u0448\u043b\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0434\u043d\u044f.<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/521394\/\"> https:\/\/habr.com\/ru\/post\/521394\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/521394\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mx\/ew\/5j\/mxew5jayb_kwoxa1fe4w1sne0cw.png\"><\/p>\n<p>  \u0414\u043e\u0431\u0440\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0443\u0442\u043e\u043a, \u0434\u0440\u0443\u0437\u044c\u044f!<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n<p>  \u0421\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u0440\u0430\u0434\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043c\u044b\u0448\u0438, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0418\u043b\u044c\u044f \u041a\u0430\u043d\u0442\u043e\u0440 \u0432 <a href=\"https:\/\/learn.javascript.ru\/mouse-drag-and-drop\" rel=\"nofollow\">\u0441\u0432\u043e\u0435\u043c \u0443\u0447\u0435\u0431\u043d\u0438\u043a\u0435<\/a>, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430, \u043e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 <a href=\"https:\/\/html.spec.whatwg.org\/multipage\/dnd.html#dnd\" rel=\"nofollow\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e<\/a>.<\/p>\n<p>  \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/f-\/2w\/rt\/f-2wrtv6rtlvnj9zbjxiuo7lv1i.png\"><\/p>\n<p>  \u041f\u0440\u0435\u0432\u044c\u044e:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nd\/ye\/iv\/ndyeivhd3l3rqaqmblhz1vva9dq.png\">  <\/p>\n<ul>\n<li><a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Web\/Guide\/HTML\/Drag_and_drop\" rel=\"nofollow\">MDN<\/a><\/li>\n<li><a href=\"https:\/\/harryheman.github.io\/drag-n-drop-example\/\" rel=\"nofollow\">\u0414\u0435\u043c\u043e<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/harryheman\/drag-n-drop-example\" rel=\"nofollow\">\u041a\u043e\u0434<\/a><\/li>\n<li><a href=\"https:\/\/codepen.io\/harryheman\/pen\/WNwBvgr\" rel=\"nofollow\">\u041f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/li>\n<\/ul>\n<p>  \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c: \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0434\u0430\u0447, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0442\u0440\u0435\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a: \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0437\u0430\u0434\u0430\u0447\u0438, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447. \u042d\u0442\u043e \u043e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u2014 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e\u0441\u044f \u043f\u043e\u0434 \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u043c, \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u0433\u0434\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u043d\u0430\u0434 \u0438\u043b\u0438 \u043f\u043e\u0434 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/getbootstrap.com\/\" rel=\"nofollow\">Bootstrap<\/a>.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0437\u0430 \u043c\u043d\u043e\u0439.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-310740","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/310740","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=310740"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/310740\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=310740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=310740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=310740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}