effective_bootstrap 0.12.7 → 0.13.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32a2c9eaed6f8b91548c0b6b418c37e1385ea9f7323b429725849a72c7aa00a4
|
4
|
+
data.tar.gz: 59f3fc9353fa3630a6dc3e0b5f1e31e75b4e1b9bae511c8ad563d96ebc11f80f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3eb4e59a05641ce7b555a8265e5d61189235b60bd2200842860c9bd8077c89dd2e500424a89007f07fae42170e1fd9116c89439509061812e2d7d917a3614019
|
7
|
+
data.tar.gz: 150b453174902f53b00e99fc751220ce583016e9de0a2ce2bb9a7d10a880420045d4d656d3b8967b606b5edcb626b7b8cf0f28e4f369ec6c1472d436f7d5be0c
|
@@ -1,18 +1,37 @@
|
|
1
|
+
// Set the document hash to the tab href
|
2
|
+
$(document).on('show.bs.tab', function (e) {
|
3
|
+
history.replaceState(null, null, '#' + e.target.getAttribute('id'));
|
4
|
+
});
|
5
|
+
|
6
|
+
// Display the tab based on form errors, the document hash, or ?tab= params
|
1
7
|
$(document).ready(function() {
|
2
|
-
var
|
8
|
+
var href = '';
|
3
9
|
|
4
|
-
|
5
|
-
$(".nav.nav-tabs").find("a[href^='#" + $tab_with_error.attr('id') + "']").tab('show');
|
6
|
-
return true;
|
10
|
+
var $tab_with_error = $(".form-control.is-invalid").first().closest('.tab-pane')
|
7
11
|
|
12
|
+
if ($tab_with_error.length > 0) {
|
13
|
+
href = $tab_with_error.attr('id')
|
14
|
+
} else if (document.location.hash.length > 0) {
|
15
|
+
var hash = document.location.hash
|
16
|
+
if(hash.startsWith('#tab-')) { href = hash.replace('#tab-', '') }
|
8
17
|
} else if (document.location.search.length > 0) {
|
9
|
-
var
|
10
|
-
if(
|
18
|
+
var param = new URLSearchParams(document.location.search).get('tab') || ''
|
19
|
+
if(param.length > 0) { href = param }
|
20
|
+
}
|
21
|
+
|
22
|
+
if (href.length > 0) {
|
23
|
+
var $tab = $(".nav.nav-tabs").find("a[href^='#" + href + "']")
|
11
24
|
|
12
|
-
$('.
|
25
|
+
$tab.parents('.tab-pane').each (function() {
|
26
|
+
$('.nav.nav-tabs').find("a[href^='#" + $(this).attr('id') + "']").tab('show')
|
27
|
+
})
|
28
|
+
|
29
|
+
$tab.tab('show')
|
13
30
|
}
|
14
31
|
});
|
15
32
|
|
33
|
+
|
34
|
+
// Click tab button
|
16
35
|
$(document).on('click', '[data-click-tab]', function(event) {
|
17
36
|
event.preventDefault();
|
18
37
|
|
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.
|
4
|
+
version: 0.13.0
|
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: 2023-03-
|
11
|
+
date: 2023-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|