PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 1.2.6
JetFormBuilder — Dynamic Blocks Form Builder v1.2.6
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / assets / lib / jquery-sortable / sortable.js
jetformbuilder / assets / lib / jquery-sortable Last commit date
sortable.js 4 years ago
sortable.js
86 lines
1 /*
2 * HTML5 Sortable jQuery Plugin
3 * http://farhadi.ir/projects/html5sortable
4 *
5 * Copyright 2012, Ali Farhadi
6 * Released under the MIT license.
7 */
8 (function($) {
9 var dragging, placeholders = $();
10 $.fn.sortable = function(options) {
11 var method = String(options);
12 options = $.extend({
13 connectWith: false
14 }, options);
15 return this.each(function() {
16 if (/^(enable|disable|destroy)$/.test(method)) {
17 var items = $(this).children($(this).data('items')).attr('draggable', method == 'enable');
18 if (method == 'destroy') {
19 items.add(this).removeData('connectWith items')
20 .off('dragstart.h5s dragend.h5s selectstart.h5s dragover.h5s dragenter.h5s drop.h5s');
21 }
22 return;
23 }
24 var isHandle, index, items = $(this).children(options.items);
25 var placeholder = $('<' + (/^(ul|ol)$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">');
26 items.find(options.handle).mousedown(function() {
27 isHandle = true;
28 }).mouseup(function() {
29 isHandle = false;
30 });
31 $(this).data('items', options.items)
32 placeholders = placeholders.add(placeholder);
33 if (options.connectWith) {
34 $(options.connectWith).add(this).data('connectWith', options.connectWith);
35 }
36 items.attr('draggable', 'true').on('dragstart.h5s', function(e) {
37 if (options.handle && !isHandle) {
38 return false;
39 }
40 isHandle = false;
41 var dt = e.originalEvent.dataTransfer;
42 dt.effectAllowed = 'move';
43 dt.setData('Text', 'dummy');
44 index = (dragging = $(this)).addClass('sortable-dragging').index();
45 }).on('dragend.h5s', function() {
46 if (!dragging) {
47 return;
48 }
49 dragging.removeClass('sortable-dragging').show();
50 placeholders.detach();
51 if (index != dragging.index()) {
52 dragging.parent().trigger('sortupdate', {item: dragging});
53 }
54 dragging = null;
55 }).not('a[href], img').on('selectstart.h5s', function() {
56 this.dragDrop && this.dragDrop();
57 return false;
58 }).end().add([this, placeholder]).on('dragover.h5s dragenter.h5s drop.h5s', function(e) {
59 if (!items.is(dragging) && options.connectWith !== $(dragging).parent().data('connectWith')) {
60 return true;
61 }
62 if (e.type == 'drop') {
63 e.stopPropagation();
64 placeholders.filter(':visible').after(dragging);
65 dragging.trigger('dragend.h5s');
66 return false;
67 }
68 e.preventDefault();
69 e.originalEvent.dataTransfer.dropEffect = 'move';
70 if (items.is(this)) {
71 if (options.forcePlaceholderSize) {
72 placeholder.height(dragging.outerHeight());
73 }
74 dragging.hide();
75 $(this)[placeholder.index() < $(this).index() ? 'after' : 'before'](placeholder);
76 placeholders.not(placeholder).detach();
77 } else if (!placeholders.is(this) && !$(this).children(options.items).length) {
78 placeholders.detach();
79 $(this).append(placeholder);
80 }
81 return false;
82 });
83 });
84 };
85 })(jQuery);
86