Bug 1032070 - [Settings] add done feature in onBeforsShow()

**another try** , WIP by the way.
I just found a cool thing which is we could simply pass the result to `Promise.resolve` and it will do the check for us.
Therefore we could simply wrap the original implementation as:
```
Promise.resolve(panel.beforeHide(currentPanelElement)).then(function() {
  return Promise.resolve(panel.beforeShow(newtPanelElement, options));
}).then(function() { //...
```