bootstrap_builders 0.0.63 → 1.0.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
  SHA1:
3
- metadata.gz: dddb715cfe5660d5ba7bed66f91f7e03d0712dcb
4
- data.tar.gz: 970ada889c4ca60115f15eade9287e414778c4f3
3
+ metadata.gz: a5280143d0ccb8c246159e93b13d811e031badf9
4
+ data.tar.gz: 43bc6c51c27f2e5321056839bc1bf042f85d852d
5
5
  SHA512:
6
- metadata.gz: f3a3271de103358422b1f9c432ad23129b49063b1f6aa666f6199966e3a8500cd7500623bceb0de0194a16a8bd1969fffa9496b1a79856dc0f0e39a07137ac41
7
- data.tar.gz: c9e0bdd58e3975ecf6aecd60161b70d156ccbdc69f054b62af9e8d37f120318f85556cf15e23d31007b198fb01a5e250c7d7fa3ba05f2dfaa377ad437cefe3ac
6
+ metadata.gz: b9e60e841fb407fafdd1d0db356426481a18da33111b5b96da6eb1c33490b44103d0bd817cc10d632b5411eafa4d935d56e58ca78bdbf64673a3f48140958883
7
+ data.tar.gz: 822e327d729662e6a3fbfa9b21bbb4904d0202f20c8d5020fb1280d3612ed99992c2e26b80720429f5709aa5860f9ea82534b267a524049a05702f95bf552d48
@@ -31,16 +31,13 @@ function loadActiveAjaxTabOnPageLoad() {
31
31
  }
32
32
  })
33
33
 
34
- var active_tab = $(".bb-tabs-container .nav li.active[data-ajax-url]")
34
+ var activeTabLink = $(".bb-tabs-container .nav li[data-ajax-url] a.active")
35
35
 
36
- if (active_tab.length > 0) {
37
- loadAjaxTab(active_tab)
38
- }
36
+ if (activeTabLink.length > 0)
37
+ loadAjaxTab(activeTabLink.parent())
39
38
  }
40
39
 
41
40
  $(document).ready(function() {
42
- loadActiveAjaxTabOnPageLoad()
43
-
44
41
  // Changes the tab on 'back' and 'forward' events
45
42
  $(window).bind("popstate", function(e) {
46
43
  if (e.originalEvent.state && e.originalEvent.state.event == "bb-tab-change") {
@@ -55,14 +52,15 @@ $(document).ready(function() {
55
52
  }
56
53
 
57
54
  var li = null
55
+ var link = null
58
56
  if (selected_tab) {
59
57
  li = $("li[data-tab-container-id='" + selected_tab + "']")
58
+ link = $("a", li)
60
59
  }
61
60
 
62
- if (li && !li.hasClass("active")) {
63
- console.log("Click on LI")
61
+ if (link && !link.hasClass("active")) {
64
62
  li.data("ignore-next-history-push", true)
65
- $("a", li).click()
63
+ link.click()
66
64
  }
67
65
  })
68
66
  })
@@ -3,5 +3,6 @@
3
3
  @import "bootstrap_builders/responsive-mixins";
4
4
  @import "bootstrap_builders/responsive-classes/hiddens";
5
5
  @import "bootstrap_builders/responsive-classes/text-aligns";
6
+ @import "bootstrap_builders/btn-xs";
6
7
  @import "bootstrap_builders/buttons";
7
8
  @import "bootstrap_builders/tabs";
@@ -0,0 +1,6 @@
1
+ .btn-xs {
2
+ padding: 1px 5px !important;
3
+ font-size: 12px !important;
4
+ line-height: 1.5 !important;
5
+ border-radius: 3px !important;
6
+ }
@@ -37,7 +37,7 @@ module BootstrapBuilders::ButtonsHelper
37
37
  args[:data][:confirm] ||= t("are_you_sure")
38
38
 
39
39
  button = BootstrapBuilders::Button.new(args.merge(icon: "remove", context: self, can_type: :destroy, method: :delete))
40
- button.classes.remove(["btn-default"])
40
+ button.classes.remove(["btn-outline-secondary"])
41
41
  button.classes.add(["btn-danger", "bb-btn", "bb-btn-destroy"])
42
42
  button.classes.add("bb-btn-destroy-#{button.can_model_class.name.tableize.singularize}") if button.can_model_class
43
43
  button.classes.add("bb-btn-destroy-#{button.can_model_class.name.tableize.singularize}-#{button.can_model.id}") if button.can_model
@@ -100,7 +100,7 @@ class BootstrapBuilders::Button
100
100
  private
101
101
 
102
102
  def add_default_as_default
103
- @classes.add("btn-default") if !@args[:danger] && !@args[:info] && !@args[:primary] && !@args[:warning]
103
+ @classes.add("btn-outline-secondary") if !@args[:danger] && !@args[:info] && !@args[:primary] && !@args[:warning]
104
104
  end
105
105
 
106
106
  def can?
@@ -72,12 +72,12 @@ class BootstrapBuilders::ButtonDropDown
72
72
  private
73
73
 
74
74
  def add_default_as_default
75
- @classes.add("btn-default") if !@args[:danger] && !@args[:info] && !@args[:primary] && !@args[:warning]
75
+ @classes.add("btn-secondary") if !@args[:danger] && !@args[:info] && !@args[:primary] && !@args[:warning]
76
76
  end
77
77
 
78
78
  def classes
79
79
  unless @classes
80
- @classes = BootstrapBuilders::ClassAttributeHandler.new(class: ["btn", "btn-default", "dropdown-toggle"])
80
+ @classes = BootstrapBuilders::ClassAttributeHandler.new(class: ["btn", "btn-secondary", "dropdown-toggle"])
81
81
  @classes.add("bb-btn-responsive") if @args[:responsive]
82
82
  add_default_as_default
83
83
  @classes.add("btn-block") if @args[:block]
@@ -60,12 +60,12 @@ class BootstrapBuilders::Panel
60
60
  private
61
61
 
62
62
  def add_heading
63
- @heading = @panel.add_ele(:div, classes: ["panel-heading", "clearfix"])
63
+ @heading = @panel.add_ele(:div, classes: ["card-header", "clearfix"])
64
64
 
65
65
  if !@title || @title.to_s.strip.empty?
66
- @heading.add_ele(:div, classes: ["panel-title", "pull-left"], str_html: " ") if controls?
66
+ @heading.add_ele(:h4, classes: ["pull-left"], str_html: " ") if controls?
67
67
  else
68
- panel_title = @heading.add_ele(:div, classes: ["panel-title", "pull-left"])
68
+ panel_title = @heading.add_ele(:div, classes: ["pull-left"])
69
69
 
70
70
  if @collapsable
71
71
  panel_title.add_ele(:a, attr: {href: "##{collapse_id}"}, data: {toggle: "collapse"}, str: @title)
@@ -116,7 +116,7 @@ private
116
116
  end
117
117
 
118
118
  def container_classes
119
- classes = ["panel", "panel-default", "bb-panel"]
119
+ classes = ["card", "bb-panel", "mb-1"]
120
120
 
121
121
  if @class.is_a?(String)
122
122
  classes += @class.split(/\s+/)
@@ -131,7 +131,7 @@ private
131
131
  if table?
132
132
  generate_body_table
133
133
  else
134
- @generated_body = @context.content_tag(:div, nil, class: "panel-body", &@block)
134
+ @generated_body = @context.content_tag(:div, nil, class: "card-body", &@block)
135
135
  end
136
136
  end
137
137
 
@@ -26,9 +26,14 @@ class BootstrapBuilders::Tabs
26
26
  container.add_ele(:div, classes: ["clearfix"])
27
27
 
28
28
  @tabs.each do |tab|
29
- li = ul.add_ele(:li, data: {specific_id_given: tab.specific_id_given?, tab_container_id: tab.container_id})
30
- li.add_ele(:a, str: tab.label, attr: {href: "##{tab.container_id}"}, data: {toggle: "tab"})
31
- li.classes << "active" if tab.active?
29
+ li = ul.add_ele(:li, attr: {class: "nav-item"}, data: {specific_id_given: tab.specific_id_given?, tab_container_id: tab.container_id})
30
+ link = li.add_ele(:a, str: tab.label, attr: {class: "nav-link", href: "##{tab.container_id}"}, data: {toggle: "tab"})
31
+
32
+ if tab.active?
33
+ link.classes << "show"
34
+ link.classes << "active"
35
+ end
36
+
32
37
  li.data[:ajax_url] = tab.ajax_url if tab.ajax_url.present?
33
38
  end
34
39
 
@@ -1,3 +1,3 @@
1
1
  module BootstrapBuilders
2
- VERSION = "0.0.63".freeze
2
+ VERSION = "1.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_builders
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.63
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaspernj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-05 00:00:00.000000000 Z
11
+ date: 2018-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: html_gen
@@ -59,6 +59,7 @@ files:
59
59
  - app/assets/stylesheets/bootstrap_builders/bb-btn-responsive.scss
60
60
  - app/assets/stylesheets/bootstrap_builders/bb-progress-bar.scss
61
61
  - app/assets/stylesheets/bootstrap_builders/bootstrap-variables.scss
62
+ - app/assets/stylesheets/bootstrap_builders/btn-xs.scss
62
63
  - app/assets/stylesheets/bootstrap_builders/buttons.scss
63
64
  - app/assets/stylesheets/bootstrap_builders/responsive-classes/hiddens.scss
64
65
  - app/assets/stylesheets/bootstrap_builders/responsive-classes/text-aligns.scss
@@ -111,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
112
  version: '0'
112
113
  requirements: []
113
114
  rubyforge_project:
114
- rubygems_version: 2.4.5.1
115
+ rubygems_version: 2.6.13
115
116
  signing_key:
116
117
  specification_version: 4
117
118
  summary: A library to generate Bootstrap HTML for Rails.