Skip to content
This repository was archived by the owner on Dec 24, 2019. It is now read-only.

Commit 8c41088

Browse files
author
monkeyphysics
committed
Merge pull request #12 from thetimpanist/master
Fixed issue where opaque items were still clickable when using the fx fade option
2 parents bd6efb9 + 54dd54a commit 8c41088

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

datepicker.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ var DatePicker = new Class({
285285
},
286286

287287
fx: function(fx) {
288+
this.newContents.setStyle('display', 'block');
288289
if (fx == 'right') {
289290
this.oldContents.setStyles({ left: 0, opacity: 1 });
290291
this.newContents.setStyles({ left: this.bodysize.x, opacity: 1 });
@@ -295,7 +296,13 @@ var DatePicker = new Class({
295296
this.slider.setStyle('left', -this.bodysize.x).tween('left', -this.bodysize.x, 0);
296297
} else if (fx == 'fade') {
297298
this.slider.setStyle('left', 0);
298-
this.oldContents.setStyle('left', 0).set('tween', { duration: this.options.animationDuration / 2 }).tween('opacity', 1, 0);
299+
this.oldContents.addClass('tween_dispose');
300+
this.oldContents.setStyle('left', 0).set('tween', { duration: this.options.animationDuration / 2, onComplete: function(){
301+
$$('.tween_dispose').each( function(d){
302+
d.setStyle('display', 'none');
303+
d.removeClass('tween_dispose');
304+
});
305+
}}).tween('opacity', 1, 0);
299306
this.newContents.setStyles({ opacity: 0, left: 0}).set('tween', { duration: this.options.animationDuration }).tween('opacity', 0, 1);
300307
}
301308
},

0 commit comments

Comments
 (0)