bullet_train-sortable 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7957d032f4dbaedb2516f60998b7f8a2f5c2601ec96809080afeae9945527eb
4
- data.tar.gz: c83aad2686779f833aea7bc9d3ac65233305a836836021208c056fc44ba9ef6e
3
+ metadata.gz: 11c6147e94228b261835e381c28d238e73736f022489a790857ab51212970bfc
4
+ data.tar.gz: c4e5a5c700f368aebe1087d7c4acc15b4f5dd8084ae6dae6a817a932595e8a02
5
5
  SHA512:
6
- metadata.gz: eda0a9a61cff10106625d00d29d6bf826304d82129b2f39e5ce469e743c7158cf97ba4d268febb63924fb0c22c0ca177fd048a8a84b0af25b0e90957fd688155
7
- data.tar.gz: 33a0c3c93dadd17f8e77b13c221becbd6cc5b0dd827de95e9671a1f28e1d698a10da51fbfe8c42cc0cf4de6288aae9e27079e0378aeeed7a1340d4a00a70e09f
6
+ metadata.gz: edca08683a8ec8982b8ecd7b826d39f672632a8455e90ad0eebee4fd2660c0e7eccca81d241ec5d209cf17871b7260a18b34e8fd882e7f0495e180dea432d955
7
+ data.tar.gz: 5487e12f52823841509a303b3485125f1f920267680ef1a7d2f5147d6875eab5fff0abde4c72efb1699870c8e4cb8e4e15003fb59ae178250074a8988b163d96
@@ -1,5 +1,6 @@
1
1
  import { Controller } from "@hotwired/stimulus"
2
2
  import { post } from '@rails/request.js'
3
+ import jquery from "jquery";
3
4
  require("dragula/dist/dragula.min.css")
4
5
 
5
6
  import dragula from 'dragula';
@@ -13,6 +14,12 @@ export default class extends Controller {
13
14
  // will be reissued as native dom events name prepended with 'sortable:' e.g. 'sortable:drag', 'sortable:drop', etc
14
15
  static pluginEventsToReissue = [ "drag", "dragend", "drop", "cancel", "remove", "shadow", "over", "out", "cloned" ]
15
16
 
17
+ initialize() {
18
+ if (window.jQuery === undefined) {
19
+ window.jQuery = jquery // required for select2 used for time zone select, but we also use global jQuery throughout below
20
+ }
21
+ }
22
+
16
23
  connect() {
17
24
  if (!this.hasReorderPathValue) { return }
18
25
  this.initPluginInstance()
@@ -26,11 +33,11 @@ export default class extends Controller {
26
33
  const self = this
27
34
  this.plugin = dragula([this.element], {
28
35
  moves: function(el, container, handle) {
29
- var $handles = $(el).find('.reorder-handle')
36
+ var $handles = jQuery(el).find('.reorder-handle')
30
37
  if ($handles.length) {
31
- return !!$(handle).closest('.reorder-handle').length
38
+ return !!jQuery(handle).closest('.reorder-handle').length
32
39
  } else {
33
- if (!$(handle).closest('.undraggable').length) {
40
+ if (!jQuery(handle).closest('.undraggable').length) {
34
41
  return self.element === container
35
42
  } else {
36
43
  return false
@@ -38,7 +45,7 @@ export default class extends Controller {
38
45
  }
39
46
  },
40
47
  accepts: function (el, target, source, sibling) {
41
- if ($(sibling).hasClass('undraggable') && $(sibling).prev().hasClass('undraggable')) {
48
+ if (jQuery(sibling).hasClass('undraggable') && jQuery(sibling).prev().hasClass('undraggable')) {
42
49
  return false
43
50
  } else {
44
51
  return true
@@ -51,7 +58,7 @@ export default class extends Controller {
51
58
  }
52
59
  }).on('over', function (el, container) {
53
60
  // deselect any text fields, or else things go slow!
54
- $(document.activeElement).blur()
61
+ jQuery(document.activeElement).blur()
55
62
  })
56
63
 
57
64
  this.initReissuePluginEventsAsNativeEvents()
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module Sortable
3
- VERSION = "1.7.1"
3
+ VERSION = "1.7.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-sortable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-29 00:00:00.000000000 Z
11
+ date: 2024-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard