MediaWiki:Common.js: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
Line 53: Line 53:
             var currentPadding = $cells.css('padding');
             var currentPadding = $cells.css('padding');
             $cellContentWrappers = $(this).find('.slideRowUp');
             $cellContentWrappers = $(this).find('.slideRowUp');
var wrappersCounterTicking = 0;
var wrappersCounter = 0;
             $cellContentWrappers.slideUp({
             $cellContentWrappers.slideUp({
duration: sR.thisCallArgs.slideSpeed,
duration: sR.thisCallArgs.slideSpeed,
easing: sR.thisCallArgs.easing,
easing: sR.thisCallArgs.easing,
progress: function(ani, num, rem){
progress: function(ani, num, rem){
if(typeof sR.thisCallArgs.callback_ticking == "function"){
wrappersCounterTicking++;
if(wrappersCounterTicking == $cellContentWrappers.length-1 && typeof sR.thisCallArgs.callback_ticking == "function"){
sR.thisCallArgs.callback_ticking.call(this);
sR.thisCallArgs.callback_ticking.call(this);
}
}
Line 69: Line 72:
$(this).parent().css({'display':'none'});
$(this).parent().css({'display':'none'});
$(this).css({'padding': currentPadding});
$(this).css({'padding': currentPadding});
if(typeof sR.thisCallArgs.callback == 'function') {
wrappersCounter++;
if(wrappersCounter == $cellContentWrappers.length-1 && typeof sR.thisCallArgs.callback == 'function') {
                         sR.thisCallArgs.callback.call(this);
                         sR.thisCallArgs.callback.call(this);
                     }
                     }
Line 111: Line 115:
             $cells.wrapInner('<div class="slideRowDown" style="display:none;" />');
             $cells.wrapInner('<div class="slideRowDown" style="display:none;" />');
             $cellContentWrappers = $cells.find('.slideRowDown');
             $cellContentWrappers = $cells.find('.slideRowDown');
var wrappersCounterTicking = 0;
var wrappersCounter = 0;
             $(this).show();
             $(this).show();
             $cellContentWrappers.slideDown({
             $cellContentWrappers.slideDown({
Line 116: Line 122:
easing: sR.thisCallArgs.easing,
easing: sR.thisCallArgs.easing,
complete: function() {
complete: function() {
$(this).replaceWith( $(this).contents());
$(this).replaceWith( $(this).contents());
if(typeof sR.thisCallArgs.callback == 'function') {
wrappersCounter++;
if(wrappersCounter == $cellContentWrappers.length-1 && typeof sR.thisCallArgs.callback == 'function') {
                         sR.thisCallArgs.callback.call(this);
                         sR.thisCallArgs.callback.call(this);
                     }
                     }
},
},
progress: function(ani, num, rem){
progress: function(ani, num, rem){
if(typeof sR.thisCallArgs.callback_ticking == "function"){
wrappersCounterTicking++;
if(wrappersCounterTicking == $cellContentWrappers.length-1 && typeof sR.thisCallArgs.callback_ticking == "function"){
sR.thisCallArgs.callback_ticking.call(this);
sR.thisCallArgs.callback_ticking.call(this);
}
}
Confirmedusers, editor, Administrators
886

edits