From 8d666d2ce1522d51fa17eda688ad512b4f940096 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Tue, 21 Feb 2017 07:04:34 +0000 Subject: [PATCH] Customize: Prevent vertical clipping of thumbnail in header image customizer control. Removes some method overrides on `wp.customize.HeaderTool.ChoiceView` introduced in [27497]. See #21785. Props bradyvercher, westonruter. Merges [40082] to the 4.7 branch. Fixes #38559. git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40100 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/customize-views.js | 42 --------------------------- 1 file changed, 42 deletions(-) diff --git a/src/wp-includes/js/customize-views.js b/src/wp-includes/js/customize-views.js index 83792cb1b6..29de08adcd 100644 --- a/src/wp-includes/js/customize-views.js +++ b/src/wp-includes/js/customize-views.js @@ -24,48 +24,10 @@ render: function() { this.$el.html(this.template(this.model.toJSON())); - this.setPlaceholder(); this.setButtons(); return this; }, - getHeight: function() { - var image = this.$el.find('img'), - saved, height, headerImageData; - - if (image.length) { - this.$el.find('.inner').hide(); - } else { - this.$el.find('.inner').show(); - return 40; - } - - saved = this.model.get('savedHeight'); - height = image.height() || saved; - - // happens at ready - if (!height) { - headerImageData = api.get().header_image_data; - - if (headerImageData && headerImageData.width && headerImageData.height) { - // hardcoded container width - height = 260 / headerImageData.width * headerImageData.height; - } - else { - // fallback for when no image is set - height = 40; - } - } - - return height; - }, - - setPlaceholder: function(_height) { - var height = _height || this.getHeight(); - this.model.set('savedHeight', height); - this.$el.height(height); - }, - setButtons: function() { var elements = $('#customize-control-header_image .actions .remove'); if (this.model.get('choice')) { @@ -132,10 +94,6 @@ }); }, - getHeight: api.HeaderTool.CurrentView.prototype.getHeight, - - setPlaceholder: api.HeaderTool.CurrentView.prototype.setPlaceholder, - select: function() { this.preventJump(); this.model.save();