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 +4 -4
- data/app/assets/javascripts/bootstrap_builders/tabs.js +7 -9
- data/app/assets/stylesheets/bootstrap_builders.scss +1 -0
- data/app/assets/stylesheets/bootstrap_builders/btn-xs.scss +6 -0
- data/app/helpers/bootstrap_builders/buttons_helper.rb +1 -1
- data/lib/bootstrap_builders/button.rb +1 -1
- data/lib/bootstrap_builders/button_drop_down.rb +2 -2
- data/lib/bootstrap_builders/panel.rb +5 -5
- data/lib/bootstrap_builders/tabs.rb +8 -3
- data/lib/bootstrap_builders/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5280143d0ccb8c246159e93b13d811e031badf9
|
4
|
+
data.tar.gz: 43bc6c51c27f2e5321056839bc1bf042f85d852d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9e60e841fb407fafdd1d0db356426481a18da33111b5b96da6eb1c33490b44103d0bd817cc10d632b5411eafa4d935d56e58ca78bdbf64673a3f48140958883
|
7
|
+
data.tar.gz: 822e327d729662e6a3fbfa9b21bbb4904d0202f20c8d5020fb1280d3612ed99992c2e26b80720429f5709aa5860f9ea82534b267a524049a05702f95bf552d48
|
@@ -31,16 +31,13 @@ function loadActiveAjaxTabOnPageLoad() {
|
|
31
31
|
}
|
32
32
|
})
|
33
33
|
|
34
|
-
var
|
34
|
+
var activeTabLink = $(".bb-tabs-container .nav li[data-ajax-url] a.active")
|
35
35
|
|
36
|
-
if (
|
37
|
-
loadAjaxTab(
|
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 (
|
63
|
-
console.log("Click on LI")
|
61
|
+
if (link && !link.hasClass("active")) {
|
64
62
|
li.data("ignore-next-history-push", true)
|
65
|
-
|
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";
|
@@ -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-
|
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-
|
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-
|
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-
|
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: ["
|
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(:
|
66
|
+
@heading.add_ele(:h4, classes: ["pull-left"], str_html: " ") if controls?
|
67
67
|
else
|
68
|
-
panel_title = @heading.add_ele(:div, classes: ["
|
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 = ["
|
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: "
|
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
|
-
|
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
|
|
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
|
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-
|
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.
|
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.
|