﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
12755	Provide an API to set editor as busy	Marek Lewandowski	Marek Lewandowski	"= Overview

During {{{mediaembed}}} plugin implementation I needed a nice way to indicate that external resource is loading.

== Presentation

I out with indicating that by changing the mouse cursor to wait icon.

But it's still not enough. We need more than that because we can't rely only on mouse cursor (mobile?).

I think that we might small spinning circle in right bottom corner of toolbar area or maybe in a corner of the viewport.

== API Implementation

We must be sure that multiple calls can occur from different plugins, and busy state will be ended only if **all** of them will unset busy state.

We might implement it in similar fashion as deferring in Bender ([#141 https://github.com/benderjs/benderjs/issues/141]). So here we should favor returning a callback rather than using a counter internally.

{{{
// From now developer is obligated to call releaseBusy().
var releaseBusy = editor.setBusy();

var myAsyncFunction = function() {
	// Do my stuff.
	releaseBusy();
};

var myAsyncError = function() {
	// Oopsy daisy, something bad happened.
	releaseBusy();
};
}}}

=== Bad Usage

Are we concerned about plugin poor implementation? Therefore not calling the function? If so we might restrict by default maximum ""lifespan"" for one callback eg. to 30s."	New Feature	closed	Normal		General		wontfix		
