bettertabs 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/jquery.bettertabs.js +10 -6
- data/app/assets/javascripts/jquery.bettertabs.js.coffee +9 -5
- data/app/assets/javascripts/jquery.bettertabs.min.js +2 -2
- data/doc/CHANGELOG.md +3 -7
- data/lib/bettertabs/version.rb +1 -1
- data/spec/dummy/app/controllers/bettertabs_controller.rb +1 -0
- metadata +11 -11
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
(function() {
|
2
2
|
/*!
|
3
3
|
jQuery Bettertabs Plugin
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4 (Sep-13-2011)
|
5
5
|
@requires jQuery v1.3 or later
|
6
6
|
|
7
7
|
Examples and documentation at: https://github.com/agoragames/bettertabs
|
@@ -34,12 +34,16 @@
|
|
34
34
|
};
|
35
35
|
$.fn.bettertabs = function() {
|
36
36
|
this.each(function() {
|
37
|
-
var
|
38
|
-
|
39
|
-
tabs =
|
40
|
-
tabs_links =
|
41
|
-
tabs_contents =
|
37
|
+
var active_tab_link, tabs, tabs_and_contents, tabs_contents, tabs_links, wrapper;
|
38
|
+
wrapper = $(this);
|
39
|
+
tabs = wrapper.find('ul.tabs > li');
|
40
|
+
tabs_links = wrapper.find('ul.tabs > li > a');
|
41
|
+
tabs_contents = wrapper.children('.content');
|
42
42
|
tabs_and_contents = tabs.add(tabs_contents);
|
43
|
+
active_tab_link = tabs_links.filter('.active');
|
44
|
+
if (tab_type_of(active_tab_link) === 'ajax') {
|
45
|
+
active_tab_link.data('content-loaded-already', true);
|
46
|
+
}
|
43
47
|
return tabs_links.click(function(event) {
|
44
48
|
var activate_tab_and_content, previous_active_tab, previous_active_tab_content, this_link, this_tab, this_tab_content;
|
45
49
|
this_link = $(this);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
###!
|
2
2
|
jQuery Bettertabs Plugin
|
3
|
-
version: 1.3.
|
3
|
+
version: 1.3.4 (Sep-13-2011)
|
4
4
|
@requires jQuery v1.3 or later
|
5
5
|
|
6
6
|
Examples and documentation at: https://github.com/agoragames/bettertabs
|
@@ -35,11 +35,15 @@ $.Bettertabs =
|
|
35
35
|
|
36
36
|
$.fn.bettertabs = ->
|
37
37
|
@each ->
|
38
|
-
|
39
|
-
tabs =
|
40
|
-
tabs_links =
|
41
|
-
tabs_contents =
|
38
|
+
wrapper = $(this)
|
39
|
+
tabs = wrapper.find 'ul.tabs > li'
|
40
|
+
tabs_links = wrapper.find 'ul.tabs > li > a'
|
41
|
+
tabs_contents = wrapper.children '.content'
|
42
42
|
tabs_and_contents = tabs.add tabs_contents
|
43
|
+
active_tab_link = tabs_links.filter '.active'
|
44
|
+
|
45
|
+
# When tab-type is ajax, mark the first active link as content-loaded-already to not be loaded again when click later
|
46
|
+
active_tab_link.data('content-loaded-already', yes) if tab_type_of(active_tab_link) is 'ajax'
|
43
47
|
|
44
48
|
tabs_links.click (event) ->
|
45
49
|
this_link = $(this)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
(function(){
|
2
2
|
/*!
|
3
3
|
jQuery Bettertabs Plugin
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4 (Sep-13-2011)
|
5
5
|
@requires jQuery v1.3 or later
|
6
6
|
|
7
7
|
Examples and documentation at: https://github.com/agoragames/bettertabs
|
@@ -11,4 +11,4 @@
|
|
11
11
|
http://www.opensource.org/licenses/mit-license.php
|
12
12
|
http://www.gnu.org/licenses/gpl.html
|
13
13
|
*/
|
14
|
-
var d,f,c,b,a,e;d=jQuery;a="data-tab-type";b="data-show-content-id";f="data-ajax-url";e=function(g){return g.attr(a)};c=function(g){return g.attr(b)};d.Bettertabs={change_browser_url:function(g){if((typeof history!=="undefined"&&history!==null)&&(history.replaceState!=null)){return history.replaceState(null,document.title,g)}},select_tab:function(h,g){return d("#"+g+"_"+h+"_tab a").click()}};d.fn.bettertabs=function(){this.each(function(){var k,h,j,
|
14
|
+
var d,f,c,b,a,e;d=jQuery;a="data-tab-type";b="data-show-content-id";f="data-ajax-url";e=function(g){return g.attr(a)};c=function(g){return g.attr(b)};d.Bettertabs={change_browser_url:function(g){if((typeof history!=="undefined"&&history!==null)&&(history.replaceState!=null)){return history.replaceState(null,document.title,g)}},select_tab:function(h,g){return d("#"+g+"_"+h+"_tab a").click()}};d.fn.bettertabs=function(){this.each(function(){var g,i,k,h,j,l;l=d(this);i=l.find("ul.tabs > li");j=l.find("ul.tabs > li > a");h=l.children(".content");k=i.add(h);g=j.filter(".active");if(e(g)==="ajax"){g.data("content-loaded-already",true)}return j.click(function(p){var r,s,o,n,q,m;n=d(this);if(e(n)!=="link"){p.preventDefault();q=n.parent();if(!q.hasClass("active")&&!n.hasClass("ajax-loading")){m=h.filter("#"+(c(n)));s=i.filter(".active");o=h.filter(".active");r=function(){i.removeClass("active");j.removeClass("active");h.removeClass("active").addClass("hidden");q.addClass("active");n.addClass("active");m.removeClass("hidden").addClass("active");o.trigger("bettertabs-after-deactivate");m.trigger("bettertabs-after-activate");return d.Bettertabs.change_browser_url(n.attr("href"))};o.trigger("bettertabs-before-deactivate");m.trigger("bettertabs-before-activate");if(e(n)==="ajax"&&!(n.data("content-loaded-already")!=null)){n.addClass("ajax-loading");m.trigger("bettertabs-before-ajax-loading");return m.load(n.attr(f),function(){n.removeClass("ajax-loading");n.data("content-loaded-already",true);m.trigger("bettertabs-after-ajax-loading");return r()})}else{return r()}}}})});return this}}).call(this);
|
data/doc/CHANGELOG.md
CHANGED
@@ -3,13 +3,9 @@ Bettertabs Changelog
|
|
3
3
|
|
4
4
|
2011-09-13 Mario Izquierdo Martinez <mizquierdo@majorleaguegaming.com>
|
5
5
|
|
6
|
-
* Tag v1.3.
|
7
|
-
*
|
8
|
-
|
9
|
-
2011-09-13 Mario Izquierdo Martinez <mizquierdo@majorleaguegaming.com>
|
10
|
-
|
11
|
-
* Tag v1.3.1
|
12
|
-
* Add 'active' class to the link element inside the active tag as well as the li element (more easy to style)
|
6
|
+
* Tag v1.3.4
|
7
|
+
* Add 'active' class to the link element inside the active tag as well as the li element (so it is now more easy to style)
|
8
|
+
* When tab-type is ajax, mark the first active link as content-loaded-already to not be loaded again when click later
|
13
9
|
|
14
10
|
2011-09-12 Mario Izquierdo Martinez <mizquierdo@majorleaguegaming.com>
|
15
11
|
|
data/lib/bettertabs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bettertabs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ default_executable:
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
17
|
-
requirement: &
|
17
|
+
requirement: &2156049080 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.1.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *2156049080
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: jquery-rails
|
28
|
-
requirement: &
|
28
|
+
requirement: &2156048500 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2156048500
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: rspec-rails
|
39
|
-
requirement: &
|
39
|
+
requirement: &2156047820 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2156047820
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: haml-rails
|
50
|
-
requirement: &
|
50
|
+
requirement: &2156047300 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2156047300
|
59
59
|
description: ! 'Bettertabs is a Rails 3.1 engine that adds a helper and jQuery plugin
|
60
60
|
to define the markup and behavior for a tabbed area in a easy and declarative way,
|
61
61
|
using the appropiate JavaScript but ensuring accessibility and usability, no matter
|
@@ -145,7 +145,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
145
|
version: '0'
|
146
146
|
segments:
|
147
147
|
- 0
|
148
|
-
hash:
|
148
|
+
hash: -751903292244497162
|
149
149
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
150
|
none: false
|
151
151
|
requirements:
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
segments:
|
156
156
|
- 0
|
157
|
-
hash:
|
157
|
+
hash: -751903292244497162
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
160
|
rubygems_version: 1.6.2
|