blacklight-spotlight 2.6.1 → 2.6.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9109f3fcbd3e089816ae4d9699ab26c0ed066c1b5e0371cfa22276315f12d362
4
- data.tar.gz: dee0e549af7ed3fcd6ce2163e20c56010ae6172e7d292fce56ad6d21c6199c75
3
+ metadata.gz: d99e741c6d655545a5e60834cd1303cff3bdb8a91f664b616e50203f877775bf
4
+ data.tar.gz: c5c5e37f19b4c210ad669417472efb886c4108d09dad793083daa0383fd31808
5
5
  SHA512:
6
- metadata.gz: 3a9a49730e8e86442d6036d339a6c3700f43b8f8f3f54bb450334ec97c9397cc19a791b70546da32c052efef9189de0a592a2426644ce48489e798c34c23ed10
7
- data.tar.gz: e189bebb6e8db4ff0101e12cf3faf3ba063286b15ccd4e0b659c56843c40374c696a869ee9adf9ecdbceafc29d3b2a6ccdd5d8cf98a51b6f8151058bc9e2a200
6
+ metadata.gz: 97065dbe90e1d70dc6b5e25fa54e0e0059b1a1cf18020edb39725042e69ad1888d46fb941fb388dafde971d52bcd04928e74f708772f6c2ccdb16c35e37c4cbf
7
+ data.tar.gz: c7caa256cfb6bba53f6dd4bc3bdd989bdbdc0e9f1ba722405a2d5d5fbadfeeaba4a283915aebca3a113ce1c08101b15fb35331909743a386f005afc9e50b50d2
@@ -4,18 +4,18 @@
4
4
  preload: true,
5
5
 
6
6
  initializeFormable: function() {
7
-
7
+
8
8
  if (_.isUndefined(this['afterLoadData'])) {
9
9
  this['afterLoadData'] = function(data) { };
10
10
  }
11
11
  },
12
-
12
+
13
13
  formId: function(id) {
14
14
  return this.blockID + "_" + id;
15
15
  },
16
16
 
17
17
  _serializeData: function() {
18
-
18
+
19
19
  var data = $(":input,textarea,select", this.inner).not(':input:radio').serializeJSON();
20
20
 
21
21
  $(':input:radio:checked', this.inner).each(function(index, input) {
@@ -30,7 +30,7 @@
30
30
  if (this.hasTextBlock()) {
31
31
  data.text = this.getTextBlockHTML();
32
32
  data.format = 'html';
33
- if (data.text.length > 0 && this.options.convertToMarkdown) {
33
+ if (data.text && data.text.length > 0 && this.options.convertToMarkdown) {
34
34
  data.text = stToMarkdown(data.text, this.type);
35
35
  data.format = 'markdown';
36
36
  }
@@ -38,27 +38,29 @@
38
38
 
39
39
  return data;
40
40
  },
41
-
41
+
42
42
  loadData: function(data){
43
- if (data.text.length > 0 && this.options.convertFromMarkdown && data.format !== "html") {
44
- this.setTextBlockHTML(SirTrevor.toHTML(data.text, this.type));
45
- } else {
46
- this.setTextBlockHTML(data.text);
43
+ if (this.hasTextBlock()) {
44
+ if (data.text && data.text.length > 0 && this.options.convertFromMarkdown && data.format !== "html") {
45
+ this.setTextBlockHTML(SirTrevor.toHTML(data.text, this.type));
46
+ } else {
47
+ this.setTextBlockHTML(data.text);
48
+ }
47
49
  }
48
50
  this.loadFormDataByKey(data);
49
51
  this.afterLoadData(data);
50
52
  },
51
-
53
+
52
54
  loadFormDataByKey: function(data) {
53
55
  $(':input', this.inner).not('button,:input[type=hidden]').each(function(index, input) {
54
56
  var key = $(input).data('key') || input.getAttribute('name');
55
57
 
56
58
  if (key) {
57
-
59
+
58
60
  if (key.match("\\[\\]$")) {
59
61
  key = key.replace("[]", "");
60
62
  }
61
-
63
+
62
64
  // by wrapping it in an array, this'll "just work" for radio and checkbox fields too
63
65
  var input_data = data[key];
64
66
 
@@ -70,7 +72,7 @@
70
72
  });
71
73
  },
72
74
  },
73
-
75
+
74
76
 
75
77
  SirTrevor.Block.prototype.availableMixins.push("formable");
76
78
  })(jQuery);
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spotlight
4
- VERSION = '2.6.1'
4
+ VERSION = '2.6.1.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-spotlight
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer