card-mod-tabs 0.18.1 → 0.19.0

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: b710aefef1f30d03e674b0f39d70dcc1daa56b595dbeb22edf7375d53fabdea1
4
- data.tar.gz: 35a53871a28488e4b2147037c754937aa1152071b7279fb550e251b9b22ea461
3
+ metadata.gz: 9b6072eb6687216da56ceded6dd79d6357dd2b014efb24533901721ff4ab638b
4
+ data.tar.gz: 8b0722d10e930b9ad8173ad7ff1200977fec72421d93eae6259ff285752d696e
5
5
  SHA512:
6
- metadata.gz: 92696e43ca6863b57fa66f03af98c550023f6e8c25103b7e8a48def4f5e0fa3fa08b8587a7c1bd58c67884a6717ecebe390cf02de5e6802e1214cfaceb3a7ef7
7
- data.tar.gz: f994fc04aede3e847369101a6f4bede6cc7659b533e2799fa95ae6d5c205e09d280d0ecdcd1f1921c0aba7136a23cf6be03efc185f5496b10fbf9b999f204cae
6
+ metadata.gz: 5edd6edd99fac4f7a46497253b72221dd60ccee691c5fd27ec0cdb136919d7d88e9c80a38544f513e43dc5fd176c59f9988a829663e74a5a0792885fa6a6d8eb
7
+ data.tar.gz: 26e115925122dd6b6f7cc2390dcde30a2f2aba8a63d9692149bfea39ef4c453bcaa285f695c7faf028806804634ddc02eaf3cd95e031062beb6466dec38f44bb
@@ -1,18 +1,22 @@
1
1
  $(window).ready ->
2
+
3
+ $('body').on 'show.bs.tab', 'a', (e) ->
4
+ tabname = $(this).data "tabName"
5
+ window.history.pushState("tab", "", "?tab=" + tabname)
6
+
2
7
  $('body').on 'show.bs.tab', 'a.load[data-bs-toggle="tab"][data-url]', (e) ->
3
8
  targ = $(e.target)
4
9
  tab_id = targ.attr "href"
5
10
  url = targ.data "url"
6
- tabname = $(this).data "tabName"
7
11
  targ.removeClass "load"
8
- tab_content = $(tab_id)
9
- # tab_content.slotReloading()
12
+ tab_pane = $(tab_id)
13
+ tab_content = tab_pane.closest(".tab-panel").children ".tab-content"
14
+ tab_content.startLoading true
10
15
 
11
16
  $.ajax
12
17
  url: url
13
18
  success: (html) ->
14
- tab_content.append(html)
15
- window.history.pushState("tab", "", "?tab=" + tabname)
16
- decko.contentLoaded tab_content, $(this)
17
- # complete: ()->
18
- # tab_content.slotLoadingComplete()
19
+ tab_pane.append(html)
20
+ decko.contentLoaded tab_pane, $(this)
21
+ complete: ()->
22
+ tab_content.stopLoading true
@@ -0,0 +1,2 @@
1
+ // tab.js.coffee
2
+ (function(){$(window).ready(function(){return $("body").on("show.bs.tab","a",function(){var t;return t=$(this).data("tabName"),window.history.pushState("tab","","?tab="+t)}),$("body").on("show.bs.tab",'a.load[data-bs-toggle="tab"][data-url]',function(t){var a,n,o,e,r;return n=(e=$(t.target)).attr("href"),r=e.data("url"),e.removeClass("load"),o=$(n),(a=o.closest(".tab-panel").children(".tab-content")).startLoading(!0),$.ajax({url:r,success:function(t){return o.append(t),decko.contentLoaded(o,$(this))},complete:function(){return a.stopLoading(!0)}})})})}).call(this);
data/lib/card/tab.rb CHANGED
@@ -16,7 +16,7 @@ class Card
16
16
 
17
17
  def active requested, keys
18
18
  r = requested.to_name
19
- r && keys.find { |k| k.to_name == r } || keys.first
19
+ (r && keys.find { |k| k.to_name == r }) || keys.first
20
20
  end
21
21
  end
22
22
 
data/set/abstract/tabs.rb CHANGED
@@ -39,14 +39,15 @@ format :html do
39
39
  options = tab_options
40
40
  tab_list.each_with_object({}) do |tab_key, hash|
41
41
  hash[tab_key] = {
42
- view: (options.dig(tab_key, :view) || "#{tab_key}_tab"),
42
+ view: options.dig(tab_key, :view) || "#{tab_key}_tab",
43
43
  title: tab_title_from_map(tab_key, options[tab_key])
44
44
  }
45
45
  end
46
46
  end
47
47
 
48
48
  def tab_from_params
49
- Env.params[:tab]&.to_sym
49
+ tab = Env.params[:tab]&.to_sym
50
+ tab if tab&.in? tab_map.keys
50
51
  end
51
52
 
52
53
  def tab_url tab
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-tabs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
8
8
  - Philipp Kühl
9
9
  - Gerry Gleason
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2024-11-22 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: card
@@ -18,28 +17,28 @@ dependencies:
18
17
  requirements:
19
18
  - - '='
20
19
  - !ruby/object:Gem::Version
21
- version: 1.108.1
20
+ version: 1.109.0
22
21
  type: :runtime
23
22
  prerelease: false
24
23
  version_requirements: !ruby/object:Gem::Requirement
25
24
  requirements:
26
25
  - - '='
27
26
  - !ruby/object:Gem::Version
28
- version: 1.108.1
27
+ version: 1.109.0
29
28
  - !ruby/object:Gem::Dependency
30
29
  name: card-mod-bootstrap
31
30
  requirement: !ruby/object:Gem::Requirement
32
31
  requirements:
33
32
  - - '='
34
33
  - !ruby/object:Gem::Version
35
- version: 0.18.1
34
+ version: 0.19.0
36
35
  type: :runtime
37
36
  prerelease: false
38
37
  version_requirements: !ruby/object:Gem::Requirement
39
38
  requirements:
40
39
  - - '='
41
40
  - !ruby/object:Gem::Version
42
- version: 0.18.1
41
+ version: 0.19.0
43
42
  description: ''
44
43
  email:
45
44
  - info@decko.org
@@ -50,7 +49,7 @@ files:
50
49
  - LICENSE
51
50
  - README.md
52
51
  - assets/script/tab.js.coffee
53
- - data/files/mod_tabs_script_asset_output/file.js
52
+ - data/files/mod_tabs/script/asset_output/file.js
54
53
  - lib/card/lazy_tab.rb
55
54
  - lib/card/tab.rb
56
55
  - set/abstract/tab_badge.haml
@@ -68,7 +67,6 @@ metadata:
68
67
  documentation_url: http://docs.decko.org/
69
68
  card-mod: tabs
70
69
  card-mod-group: gem-defaults
71
- post_install_message:
72
70
  rdoc_options: []
73
71
  require_paths:
74
72
  - lib
@@ -76,15 +74,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
74
  requirements:
77
75
  - - ">="
78
76
  - !ruby/object:Gem::Version
79
- version: '3.0'
77
+ version: '3.2'
80
78
  required_rubygems_version: !ruby/object:Gem::Requirement
81
79
  requirements:
82
80
  - - ">="
83
81
  - !ruby/object:Gem::Version
84
82
  version: '0'
85
83
  requirements: []
86
- rubygems_version: 3.5.10
87
- signing_key:
84
+ rubygems_version: 3.6.8
88
85
  specification_version: 4
89
86
  summary: tabs
90
87
  test_files: []
@@ -1,2 +0,0 @@
1
- // tab.js.coffee
2
- (function(){$(window).ready(function(){return $("body").on("show.bs.tab",'a.load[data-bs-toggle="tab"][data-url]',function(t){var a,n,o,e,r;return n=(e=$(t.target)).attr("href"),r=e.data("url"),o=$(this).data("tabName"),e.removeClass("load"),a=$(n),$.ajax({url:r,success:function(t){return a.append(t),window.history.pushState("tab","","?tab="+o),decko.contentLoaded(a,$(this))}})})})}).call(this);