jsuites 4.13.4 → 4.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,6 +16,10 @@
16
16
  --safe-area-bottom: env(safe-area-inset-bottom);
17
17
  }
18
18
 
19
+ [data-visible="false"] {
20
+ display: none;
21
+ }
22
+
19
23
  div[data-before]:before {
20
24
  content: attr(data-before);
21
25
  }
@@ -17,7 +17,7 @@
17
17
 
18
18
  var jSuites = {};
19
19
 
20
- var Version = '4.13.4';
20
+ var Version = '4.13.5';
21
21
 
22
22
  var Events = function() {
23
23
 
@@ -37,7 +37,7 @@ var Events = function() {
37
37
  }
38
38
 
39
39
  var isOpened = function(e) {
40
- if (document.jSuitesCurrent && document.jsuitesComponents.length > 0) {
40
+ if (document.jsuitesComponents && document.jsuitesComponents.length > 0) {
41
41
  for (var i = 0; i < document.jsuitesComponents.length; i++) {
42
42
  if (document.jsuitesComponents[i] && ! find(e, document.jsuitesComponents[i])) {
43
43
  document.jsuitesComponents[i].close();
@@ -3964,8 +3964,20 @@ jSuites.dropdown = (function(el, options) {
3964
3964
  }
3965
3965
 
3966
3966
  obj.setData = function(data) {
3967
+ // Reset current value
3968
+ resetValue();
3969
+
3970
+ // Make sure the content container is blank
3971
+ content.innerHTML = '';
3972
+
3973
+ // Reset
3974
+ obj.header.value = '';
3975
+
3976
+ // Reset items and values
3977
+ obj.items = [];
3978
+
3967
3979
  // Prepare data
3968
- if (data.length) {
3980
+ if (data && data.length) {
3969
3981
  for (var i = 0; i < data.length; i++) {
3970
3982
  // Compatibility
3971
3983
  if (typeof(data[i]) != 'object') {
@@ -3984,24 +3996,17 @@ jSuites.dropdown = (function(el, options) {
3984
3996
  }
3985
3997
  }
3986
3998
 
3987
- // Reset current value
3988
- resetValue();
3989
-
3990
- // Make sure the content container is blank
3991
- content.innerHTML = '';
3992
-
3993
- // Reset
3994
- obj.header.value = '';
3995
-
3996
- // Reset items and values
3997
- obj.items = [];
3998
-
3999
3999
  // Append data
4000
4000
  obj.appendData(data);
4001
4001
 
4002
4002
  // Update data
4003
4003
  obj.options.data = data;
4004
+ } else {
4005
+ // Update data
4006
+ obj.options.data = [];
4004
4007
  }
4008
+
4009
+ obj.close();
4005
4010
  }
4006
4011
 
4007
4012
  obj.getData = function() {
package/dist/jsuites.css CHANGED
@@ -16,6 +16,10 @@
16
16
  --safe-area-bottom: env(safe-area-inset-bottom);
17
17
  }
18
18
 
19
+ [data-visible="false"] {
20
+ display: none;
21
+ }
22
+
19
23
  div[data-before]:before {
20
24
  content: attr(data-before);
21
25
  }
package/dist/jsuites.js CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  var jSuites = {};
19
19
 
20
- var Version = '4.13.4';
20
+ var Version = '4.13.5';
21
21
 
22
22
  var Events = function() {
23
23
 
@@ -37,7 +37,7 @@ var Events = function() {
37
37
  }
38
38
 
39
39
  var isOpened = function(e) {
40
- if (document.jSuitesCurrent && document.jsuitesComponents.length > 0) {
40
+ if (document.jsuitesComponents && document.jsuitesComponents.length > 0) {
41
41
  for (var i = 0; i < document.jsuitesComponents.length; i++) {
42
42
  if (document.jsuitesComponents[i] && ! find(e, document.jsuitesComponents[i])) {
43
43
  document.jsuitesComponents[i].close();
@@ -3975,8 +3975,20 @@ jSuites.dropdown = (function(el, options) {
3975
3975
  }
3976
3976
 
3977
3977
  obj.setData = function(data) {
3978
+ // Reset current value
3979
+ resetValue();
3980
+
3981
+ // Make sure the content container is blank
3982
+ content.innerHTML = '';
3983
+
3984
+ // Reset
3985
+ obj.header.value = '';
3986
+
3987
+ // Reset items and values
3988
+ obj.items = [];
3989
+
3978
3990
  // Prepare data
3979
- if (data.length) {
3991
+ if (data && data.length) {
3980
3992
  for (var i = 0; i < data.length; i++) {
3981
3993
  // Compatibility
3982
3994
  if (typeof(data[i]) != 'object') {
@@ -3995,24 +4007,17 @@ jSuites.dropdown = (function(el, options) {
3995
4007
  }
3996
4008
  }
3997
4009
 
3998
- // Reset current value
3999
- resetValue();
4000
-
4001
- // Make sure the content container is blank
4002
- content.innerHTML = '';
4003
-
4004
- // Reset
4005
- obj.header.value = '';
4006
-
4007
- // Reset items and values
4008
- obj.items = [];
4009
-
4010
4010
  // Append data
4011
4011
  obj.appendData(data);
4012
4012
 
4013
4013
  // Update data
4014
4014
  obj.options.data = data;
4015
+ } else {
4016
+ // Update data
4017
+ obj.options.data = [];
4015
4018
  }
4019
+
4020
+ obj.close();
4016
4021
  }
4017
4022
 
4018
4023
  obj.getData = function() {
package/package.json CHANGED
@@ -19,7 +19,7 @@
19
19
  "javascript plugins"
20
20
  ],
21
21
  "main": "dist/jsuites.js",
22
- "version": "4.13.4",
22
+ "version": "4.13.5",
23
23
  "bugs": "https://github.com/jsuites/jsuites/issues",
24
24
  "homepage": "https://github.com/jsuites/jsuites",
25
25
  "docs": "https://jsuites.net",