effective_bootstrap 0.11.17 → 0.11.19
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 +4 -4
- data/app/assets/javascripts/effective_bootstrap/load_ajax.js +32 -0
- data/app/assets/javascripts/effective_bootstrap/tabs.js +1 -1
- data/app/assets/javascripts/effective_bootstrap.js +1 -0
- data/app/assets/javascripts/effective_select/initialize.js.coffee +4 -6
- data/lib/effective_bootstrap/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b37527409a84a7dcd2c26b1bd3264e9450a2c4782644e54108a14005d1f9e44
|
4
|
+
data.tar.gz: a250baf131c0e5549b391d61160c72674c081449dd7158fd732f5c30c91fc316
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a67fe0e30fecf152e3e3c980ec67c0f6ecddab3b4212429654d923e83571a3d93c2e72cddf433c737e847c6c7cf7a1044f266e32b57b62fa03c92c0b3e83bf8
|
7
|
+
data.tar.gz: 93a1be51fc431ef61a3ea4b36fe23c1979424570ccfca0b67adc86790e434064973b567da47456f6dd99f6a2cadc6ff39385e09bc4827db970e172f66b81d553
|
@@ -0,0 +1,32 @@
|
|
1
|
+
// Implements the jQuery load div pattern
|
2
|
+
// See effective_reports admin screen
|
3
|
+
$(document).on('change', "[data-load-ajax-url][data-load-ajax-div]", function(event) {
|
4
|
+
let $input = $(event.currentTarget);
|
5
|
+
|
6
|
+
let url = $input.data('load-ajax-url');
|
7
|
+
let div = $input.data('load-ajax-div');
|
8
|
+
|
9
|
+
let $container = $input.closest('form').find(div);
|
10
|
+
if(div.length == 0) { console.error("Unable to find load ajax div " + div); return; }
|
11
|
+
|
12
|
+
let name = ($input.attr('name').split(/\[|\]/)[1] || '');
|
13
|
+
if(name.length == 0) { console.error("Unable to parse load ajax input name " + $input.attr('name')); return; }
|
14
|
+
|
15
|
+
let value = ($input.val() || '');
|
16
|
+
if(value.length == 0) { $container.html(''); return; }
|
17
|
+
|
18
|
+
url = (url + '?' + name + '=' + value);
|
19
|
+
|
20
|
+
$container.html("<div class='load-ajax-loading'><p>Loading...</p></div>");
|
21
|
+
|
22
|
+
let $content = $('<div></div>');
|
23
|
+
|
24
|
+
$content.load(url + ' ' + div, function(response, status, xhr) {
|
25
|
+
if(status == 'error') {
|
26
|
+
$container.append("<div class='load-ajax-error'><p>Error: please refresh the page and try again.</p></div>");
|
27
|
+
} else {
|
28
|
+
$container.replaceWith($content.children(div));
|
29
|
+
EffectiveBootstrap.initialize();
|
30
|
+
}
|
31
|
+
});
|
32
|
+
});
|
@@ -7,7 +7,7 @@ $(document).ready(function() {
|
|
7
7
|
|
8
8
|
} else if (document.location.search.length > 0) {
|
9
9
|
var tab = new URLSearchParams(document.location.search).get('tab');
|
10
|
-
if(tab.length == 0) { return false; }
|
10
|
+
if((tab || '').length == 0) { return false; }
|
11
11
|
|
12
12
|
$('.nav.nav-tabs').find("a[href^='#" + tab + "']").tab('show');
|
13
13
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
//= require ./effective_bootstrap/base
|
2
2
|
//= require ./effective_bootstrap/confirm
|
3
3
|
//= require ./effective_bootstrap/form
|
4
|
+
//= require ./effective_bootstrap/load_ajax
|
4
5
|
//= require ./effective_bootstrap/logic
|
5
6
|
//= require ./effective_bootstrap/other
|
6
7
|
//= require ./effective_bootstrap/reveal_mail_to
|
@@ -21,10 +21,8 @@ effectiveMatch = (params, data) ->
|
|
21
21
|
try text = $(data.text).text() if text.length == 0
|
22
22
|
text = data.text if text.length == 0
|
23
23
|
|
24
|
-
if
|
25
|
-
|
26
|
-
|
27
|
-
return null unless data.children?
|
24
|
+
return(data) if text.length > 0 && text.toLowerCase().indexOf(term) > -1
|
25
|
+
return(null) unless data.children?
|
28
26
|
|
29
27
|
# OptGroup mode
|
30
28
|
filteredChildren = []
|
@@ -33,8 +31,8 @@ effectiveMatch = (params, data) ->
|
|
33
31
|
# Text value
|
34
32
|
text = ''
|
35
33
|
try text = $(child.element.getAttribute('data-html')).text()
|
36
|
-
try text = $(
|
37
|
-
text =
|
34
|
+
try text = $(child.text).text() if text.length == 0
|
35
|
+
text = child.text if text.length == 0
|
38
36
|
|
39
37
|
filteredChildren.push(child) if text.toLowerCase().indexOf(term) > -1
|
40
38
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -426,6 +426,7 @@ files:
|
|
426
426
|
- app/assets/javascripts/effective_bootstrap/base.js.coffee
|
427
427
|
- app/assets/javascripts/effective_bootstrap/confirm.js.coffee.erb
|
428
428
|
- app/assets/javascripts/effective_bootstrap/form.js.coffee
|
429
|
+
- app/assets/javascripts/effective_bootstrap/load_ajax.js
|
429
430
|
- app/assets/javascripts/effective_bootstrap/logic.js.coffee
|
430
431
|
- app/assets/javascripts/effective_bootstrap/other.js.coffee
|
431
432
|
- app/assets/javascripts/effective_bootstrap/reveal_mail_to.js
|