doAction( “blur_area” )

  1. Home
  2. Knowledge Base
  3. Codex
  4. JS API
  5. JS Actions
  6. doAction( “blur_area” )
DiviArea.doAction( 'blur_area', area );
DiviArea.doAction( 'blur_area_{id}', area );

Fires, after an area lost the “focus” state. This happens either because a different Area received the “focus” state or the current Area is about to be hidden.

If the page contains multiple Popups, only one Popup can have the “focus” state at any moment.

The {id} part in the hook name is the sanitized area-ID (all lower case, dashes changed to underscores).

Params

area
(DiviAreaItem) The area which just lost focus.

Examples

// Remove a special CSS class when an Area lost focus.
DiviArea.addAction( 'blur_area', function( area ) {
    area.removeClass( 'special-focus' );
});

Notes

During the “blur” process, all event handlers are detached from the Area (i.e., custom close buttons are removed, etc). At the end of that process, the blur_area event is fired.

Was this article helpful?

Related Articles