Skip to content

Commit d597c7e

Browse files
author
bradrobertson
committed
Merge branch 'dev' of github.com:jquerytools/jquerytools into dev
2 parents 9cb13eb + 8ac4636 commit d597c7e

File tree

16 files changed

+159
-20
lines changed

16 files changed

+159
-20
lines changed

src/scrollable/scrollable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@
256256
}
257257

258258
// next/prev buttons
259-
var prev = find(root, conf.prev).click(function() { self.prev(); }),
260-
next = find(root, conf.next).click(function() { self.next(); });
259+
var prev = find(root, conf.prev).click(function(e) { e.stopPropagation(); self.prev(); }),
260+
next = find(root, conf.next).click(function(e) { e.stopPropagation(); self.next(); });
261261

262262
if (!conf.circular) {
263263
self.onBeforeSeek(function(e, i) {

src/tabs/tabs.js

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,52 @@
9090
* @deprecated will be replaced with a more robust implementation
9191
*/
9292

93-
var w;
93+
var
94+
/**
95+
* @type {Boolean}
96+
*
97+
* Mutex to control horizontal animation
98+
* Disables clicking of tabs while animating
99+
* They mess up otherwise as currentPane gets set *after* animation is done
100+
*/
101+
animating,
102+
/**
103+
* @type {Number}
104+
*
105+
* Initial width of tab panes
106+
*/
107+
w;
94108

95109
$.tools.tabs.addEffect("horizontal", function(i, done) {
110+
if (animating) return; // don't allow other animations
96111

112+
var nextPane = this.getPanes().eq(i),
113+
currentPane = this.getCurrentPane();
114+
97115
// store original width of a pane into memory
98116
w || ( w = this.getPanes().eq(0).width() );
117+
animating = true;
99118

100-
// set current pane's width to zero
101-
this.getCurrentPane().animate({width: 0}, function(){
102-
$(this).hide();
103-
});
119+
nextPane.show(); // hidden by default
104120

105-
// grow opened pane to it's original width
106-
this.getPanes().eq(i).animate({width: w}, function() {
107-
$(this).show();
108-
done.call();
121+
// animate current pane's width to zero
122+
// animate next pane's width at the same time for smooth animation
123+
currentPane.animate({width: 0}, {
124+
step: function(now){
125+
nextPane.css("width", w-now);
126+
},
127+
complete: function(){
128+
$(this).hide();
129+
done.call();
130+
animating = false;
131+
}
109132
});
110-
133+
// Dirty hack... onLoad, currentPant will be empty and nextPane will be the first pane
134+
// If this is the case, manually run callback since the animation never occured, and reset animating
135+
if (!currentPane.length){
136+
done.call();
137+
animating = false;
138+
}
111139
});
112140

113141

@@ -130,7 +158,7 @@
130158
$.extend(this, {
131159
click: function(i, e) {
132160

133-
var tab = tabs.eq(i);
161+
var tab = tabs.eq(i);
134162

135163
if (typeof i == 'string' && i.replace("#", "")) {
136164
tab = tabs.filter("[href*=" + i.replace("#", "") + "]");
@@ -160,11 +188,10 @@
160188

161189
// call the effect
162190
effects[conf.effect].call(self, i, function() {
163-
191+
current = i;
164192
// onClick callback
165193
e.type = "onClick";
166-
trigger.trigger(e, [i]);
167-
current = i;
194+
trigger.trigger(e, [i]);
168195
});
169196

170197
// default behaviour

test/dateinput/skin1.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
text-align:center;
1010
width:194px;
1111
-moz-box-shadow:0 0 10px #eee inset;
12+
box-shadow:0 0 10px #eee inset;
1213
}
1314

1415
/* calendar root element */
@@ -21,9 +22,11 @@
2122
border:1px solid #ccc;
2223
z-index:1;
2324
-moz-border-radius:5px;
25+
border-radius:5px;
2426
-webkit-border-radius:5px;
2527
-moz-box-shadow: 0 0 15px #666;
2628
-webkit-box-shadow: 0 0 15px #666;
29+
box-shadow: 0 0 15px #666;
2730
}
2831

2932
/* head. contains title, prev/next month controls and possible month/year selectors */

test/form/dateinput.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
font-size:11px;
66
-moz-border-radius:5px;
77
-webkit-border-radius:5px;
8+
border-radius:5px;
89
-moz-box-shadow: 0 0 20px #999;
910
-webkit-box-shadow: 0 0 20px #999;
11+
box-shadow: 0 0 20px #999;
1012
}
1113

1214
#datehead {
@@ -93,6 +95,7 @@
9395
color:#666;
9496
-moz-border-radius:3px;
9597
-webkit-border-radius:3px;
98+
border-radius:3px;
9699
}
97100

98101
.pickweek a:hover, .pickfocus {

test/overlay/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ div.overlay a.close {
2020
height:200px;
2121
background-color:#666;
2222
-moz-border-radius:15px;
23+
border-radius:15px;
2324
}
2425

2526
#overlay2 {

test/rangeinput/css/multiple.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
width:670px;
77
-moz-border-radius:5px;
88
-webkit-border-radius:5px;
9+
border-radius:5px;
910
}
1011

1112
.column {

test/rangeinput/css/skin1.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
cursor:pointer;
1414
margin:15px 0;
1515
-moz-border-radius:5px;
16+
border-radius:5px;
1617
border:1px inset #333;
1718
width:400px;
1819
float:left;
@@ -35,6 +36,7 @@
3536
display:block;
3637
margin-top:1px;
3738
-moz-border-radius:14px;
39+
border-radius:14px;
3840
}
3941

4042
.range {

test/rangeinput/css/small.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
color:#fff;
2828
-moz-border-radius:2px;
2929
-webkit-border-radius:2px;
30+
border-radius:2px;
3031
}
3132

3233
.range:focus {

test/rangeinput/scrollbar.htm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
margin-bottom:15px;
2222
-moz-box-shadow:0 0 20px #666;
2323
-webkit-box-shadow:0 0 20px #666;
24+
box-shadow:0 0 20px #666;
2425
}
2526

2627
#scroll {
@@ -42,6 +43,7 @@
4243
border:2px solid #00118E;
4344
width:658px;
4445
-moz-border-radius:2px;
46+
border-radius:2px;
4547
}
4648

4749
.handle {
@@ -55,6 +57,7 @@
5557
cursor:move;
5658
-moz-border-radius:14px;
5759
-webkit-border-radius:14px;
60+
border-radius:14px;
5861
}
5962

6063
.handle:active {

test/scrollable/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
margin-right: 20px;
3131
float:left;
3232
-moz-border-radius:5px;
33+
border-radius:5px;
3334
}
3435

3536
.navi {

0 commit comments

Comments
 (0)