From 82ac1009c43aa9b20b04d97445891dc8aec9e82a Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Tue, 8 Apr 2014 11:20:34 +0000 Subject: [PATCH] Move `toolbar` declaration after the `:visible` check, like it was before [28019]. props kovshenin. fixes #24859. git-svn-id: https://develop.svn.wordpress.org/trunk@28046 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-views.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index e69993f04f..0051bef32c 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -4903,13 +4903,14 @@ scroll: function() { var view = this, - toolbar = this.views.parent.toolbar; + toolbar; - // @todo: is :visible still necessary? if ( ! this.$el.is(':visible') || ! this.collection.hasMore() ) { return; } + toolbar = this.views.parent.toolbar; + // Show the spinner only if we are close to the bottom. if ( this.el.scrollHeight - ( this.el.scrollTop + this.el.clientHeight ) < this.el.clientHeight / 3 ) { toolbar.get('spinner').show();