When creating an EmbedLink view, don't add a spinner - it already exists in Embed.

Use the value of `wp.media.controller.Embed.sensitivity` as the sensitivity value for the debounced method in `EmbedLink` to ensure that the spinner toggles don't stutter or overlap.

Fixes #32036.


git-svn-id: https://develop.svn.wordpress.org/trunk@32462 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-05-08 20:09:58 +00:00
parent 637bedeece
commit bbcddbbb72
3 changed files with 4 additions and 8 deletions

View File

@ -503,7 +503,7 @@ Embed = wp.media.controller.State.extend({
},
// The amount of time used when debouncing the scan.
sensitivity: 200,
sensitivity: 400,
initialize: function(options) {
this.metadata = options.metadata;
@ -4533,8 +4533,6 @@ EmbedLink = wp.media.view.Settings.extend({
template: wp.template('embed-link-settings'),
initialize: function() {
this.spinner = $('<span class="spinner" />');
this.$el.append( this.spinner[0] );
this.listenTo( this.model, 'change:url', this.updateoEmbed );
},
@ -4551,7 +4549,7 @@ EmbedLink = wp.media.view.Settings.extend({
}
this.fetch();
}, 600 ),
}, wp.media.controller.Embed.sensitivity ),
fetch: function() {
var embed;

View File

@ -39,7 +39,7 @@ Embed = wp.media.controller.State.extend({
},
// The amount of time used when debouncing the scan.
sensitivity: 200,
sensitivity: 400,
initialize: function(options) {
this.metadata = options.metadata;

View File

@ -17,8 +17,6 @@ EmbedLink = wp.media.view.Settings.extend({
template: wp.template('embed-link-settings'),
initialize: function() {
this.spinner = $('<span class="spinner" />');
this.$el.append( this.spinner[0] );
this.listenTo( this.model, 'change:url', this.updateoEmbed );
},
@ -35,7 +33,7 @@ EmbedLink = wp.media.view.Settings.extend({
}
this.fetch();
}, 600 ),
}, wp.media.controller.Embed.sensitivity ),
fetch: function() {
var embed;