Force $digest() cycle to occur
Watch for scope destruction and remove the binding

Remove the binding if the scope is destroyed.
Move unbinding to .close()

Move unbinding the keyup event to .close() as we don't need the binding anymore if the panel has been closed via the button press.