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:
parent
637bedeece
commit
bbcddbbb72
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user