anjlab-bootstrap-rails 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -66,10 +66,10 @@ Add necessary javascript(s) files to app/assets/javascripts/application.js
66
66
  //= require bootstrap-alerts
67
67
  //= require bootstrap-dropdown
68
68
  //= require bootstrap-modal
69
+ //= require bootstrap-twipsy
69
70
  //= require bootstrap-popover
70
71
  //= require bootstrap-scrollspy
71
72
  //= require bootstrap-tabs
72
- //= require bootstrap-twipsy
73
73
  ```
74
74
 
75
75
  ## Thanks
@@ -1,5 +1,5 @@
1
1
  module Bootstrap
2
2
  module Rails
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
@@ -60,7 +60,7 @@
60
60
  if ( options ) {
61
61
  $.extend( this.settings, options )
62
62
 
63
- if ( options.show ) {
63
+ if ( this.settings.show ) {
64
64
  this.show()
65
65
  }
66
66
  }
@@ -81,17 +81,23 @@
81
81
 
82
82
  escape.call(this)
83
83
  backdrop.call(this, function () {
84
+ var transition = $.support.transition && that.$element.hasClass('fade')
85
+
84
86
  that.$element
85
87
  .appendTo(document.body)
86
88
  .show()
87
89
 
88
- if ($.support.transition && that.$element.hasClass('fade')) {
90
+ if (transition) {
89
91
  that.$element[0].offsetWidth // force reflow
90
92
  }
91
93
 
92
94
  that.$element
93
95
  .addClass('in')
94
- .trigger('shown')
96
+
97
+ transition ?
98
+ that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
99
+ that.$element.trigger('shown')
100
+
95
101
  })
96
102
 
97
103
  return this
@@ -100,6 +106,10 @@
100
106
  , hide: function (e) {
101
107
  e && e.preventDefault()
102
108
 
109
+ if ( !this.isShown ) {
110
+ return this
111
+ }
112
+
103
113
  var that = this
104
114
  this.isShown = false
105
115
 
@@ -220,7 +230,7 @@
220
230
  $.fn.modal.defaults = {
221
231
  backdrop: false
222
232
  , keyboard: false
223
- , show: true
233
+ , show: false
224
234
  }
225
235
 
226
236
 
@@ -235,4 +245,4 @@
235
245
  })
236
246
  })
237
247
 
238
- }( window.jQuery || window.ender );
248
+ }( window.jQuery || window.ender );
@@ -21,27 +21,33 @@
21
21
  !function( $ ){
22
22
 
23
23
  function activate ( element, container ) {
24
- container.find('.active').removeClass('active')
24
+ container.find('> .active').removeClass('active')
25
25
  element.addClass('active')
26
26
  }
27
27
 
28
28
  function tab( e ) {
29
29
  var $this = $(this)
30
- , href = $this.attr('href')
31
30
  , $ul = $this.closest('ul')
32
- , $controlled
31
+ , href = $this.attr('href')
32
+ , previous
33
33
 
34
34
  if (/^#\w+/.test(href)) {
35
35
  e.preventDefault()
36
36
 
37
- if ($this.hasClass('active')) {
37
+ if ($this.parent('li').hasClass('active')) {
38
38
  return
39
39
  }
40
40
 
41
+ previous = $ul.find('.active a')[0]
41
42
  $href = $(href)
42
43
 
43
44
  activate($this.parent('li'), $ul)
44
45
  activate($href, $href.parent())
46
+
47
+ $this.trigger({
48
+ type: 'change'
49
+ , relatedTarget: previous
50
+ })
45
51
  }
46
52
  }
47
53
 
@@ -59,4 +65,4 @@
59
65
  $('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
60
66
  })
61
67
 
62
- }( window.jQuery || window.ender );
68
+ }( window.jQuery || window.ender );
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anjlab-bootstrap-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-23 00:00:00.000000000 Z
12
+ date: 2011-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
- requirement: &70135101107960 !ruby/object:Gem::Requirement
16
+ requirement: &70199458906960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70135101107960
24
+ version_requirements: *70199458906960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: thor
27
- requirement: &70135101107420 !ruby/object:Gem::Requirement
27
+ requirement: &70199458906440 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0.14'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70135101107420
35
+ version_requirements: *70199458906440
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &70135101106940 !ruby/object:Gem::Requirement
38
+ requirement: &70199458905940 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.0.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70135101106940
46
+ version_requirements: *70199458905940
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rails
49
- requirement: &70135101106400 !ruby/object:Gem::Requirement
49
+ requirement: &70199458905460 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '3.0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70135101106400
57
+ version_requirements: *70199458905460
58
58
  description: Twitter Bootstrap CSS (with SASS flavour) and JS toolkits for Rails 3
59
59
  projects
60
60
  email:
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 1.8.9
112
+ rubygems_version: 1.8.10
113
113
  signing_key:
114
114
  specification_version: 3
115
115
  summary: Bootstrap CSS (with SASS flavour) and JS toolkits for Rails 3 projects