javascripts/right-tabs-src.js in right-rails-0.4.2 vs javascripts/right-tabs-src.js in right-rails-0.4.3
- old
+ new
@@ -308,21 +308,21 @@
},
// protected
resizing: function(callback) {
- if (this.__working) return this.resizing.bind(this, callback).delay(20);
+ if (Tabs.__working) return this.resizing.bind(this, callback).delay(20);
var controller = this.tab.controller;
var options = controller.options;
var prev_panel = controller.element.subNodes().first('hasClass', 'right-tabs-panel-current');
var this_panel = this.element;
var swapping = prev_panel != this_panel;
var loading = this.element.first('div.right-tabs-panel-locker');
if (options.resizeFx && self.Fx && prev_panel && (swapping || loading)) {
- this.__working = true;
+ Tabs.__working = true;
// calculating the visual effects durations
var fx_name = (options.resizeFx == 'both' && loading) ? 'slide' : options.resizeFx;
var duration = options.resizeDuration; duration = Fx.Durations[duration] || duration;
var resize_duration = fx_name == 'fade' ? 0 : fx_name == 'slide' ? duration : duration / 2;
@@ -338,21 +338,20 @@
callback.call(this);
// getting the new size
var new_panel_height = this_panel.offsetHeight;
-
if (fx_name != 'fade' && prev_panel_height != new_panel_height) {
// preserving the whole element size so it didn't jump when we are tossing the tabs around
controller.element.style.height = controller.element.offsetHeight + 'px';
// wrapping the element with an overflowed element to visualize the resize
- var fx_wrapper = $E('div', {'class': 'right-tabs-resizer'}).setHeight(prev_panel_height);
+ var fx_wrapper = $E('div', {'class': 'right-tabs-resizer'});
var set_back = fx_wrapper.replace.bind(fx_wrapper, this_panel);
this_panel.wrap(fx_wrapper);
+ fx_wrapper.setHeight(prev_panel_height);
-
// in case of harmonica nicely hidding the previous panel
if (controller.isHarmonica && swapping) {
prev_panel.addClass('right-tabs-panel-current');
var hide_wrapper = $E('div', {'class': 'right-tabs-resizer'}).setHeight(prev_panel.offsetHeight);
var prev_back = function() {
@@ -374,10 +373,10 @@
if (fx_name != 'slide')
this_panel.morph.bind(this_panel, {opacity: 1}, {duration: fade_duration}).delay(resize_duration);
// removing the working marker
- (function() { this.__working = false; }).bind(this).delay(duration);
+ (function() { Tabs.__working = false; }).bind(this).delay(duration);
} else {
callback.call(this);
}
return this;
\ No newline at end of file