Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#32036 closed defect (bug) (fixed)

Media views EmbedLink spinner

Reported by: afercia's profile afercia Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.1
Component: Media Keywords: has-patch
Focuses: ui, javascript Cc:

Description

When inserting an embeddable media with "Insert from URL", the spinner is shown while you're typing. As I see it, shouldn't work this way. The spinner should be shown when you stop typing, the AJAX call fires and you're waiting for a response.
To reproduce:

  • edit a post
  • Add media > Insert from URL
  • remove http:// from the field and slowly type less then 6 characters
  • fetching the embed will start just if you type more than 6 characters but this is useful to clearly see what's happening
  • for each character you type or remove (each change event), the spinner will be displayed

Attachments (1)

32036.diff (1.9 KB) - added by wonderboymusic 9 years ago.

Download all attachments as: .zip

Change History (3)

@wonderboymusic
9 years ago

#1 @wonderboymusic
9 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.3

A few issues here:

  • We don't need 2 spinners
  • If the debounce sensitivity isn't the same between the 2 views (Embed and EmbedLink), the change events will overlap, which is why the spinner is showing too often
  • EmbedLink should use the same sensitivity as defined by the Embed controller

#2 @wonderboymusic
9 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 32462:

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.

Note: See TracTickets for help on using tickets.