livebook/assets/js/scroll_on_update/index.js
Jonatan Kłosko 663ec3283e
Support starting runtime in Mix context (#61)
* Prototype standalone mode with mix

* Move runtime initialization into separate LiveViews

* Make standalone node initialization async

* Refactor async node initialization

* Automatically scroll to the bottom of output

* Refactor streaming output

* Move MessageEmitter under Utils

* Add path selector to the mix runtime picker

* Update runtime descriptions

* Add successful or error message at the end of output

* Run formatter

* Rename Standalone to ElixirStandalone for consistency

* Show only directories when looking for a mix project

* Update docs

* Extract shared standalone logic

* Make the remote primary process monitor Manager instead of session

* Further refactoring and docs

* Add tests for collectable Callback

* Add missing macro doc

* Apply review suggestions

* Decouple sending asynchronous notifications from the runtime initialization

* Apply suggestions
2021-02-26 20:53:29 +01:00

19 lines
304 B
JavaScript

/**
* A hook used to scroll to the bottom of an element
* whenever it receives LV update.
*/
const ScrollOnUpdate = {
mounted() {
this.__scroll();
},
updated() {
this.__scroll();
},
__scroll() {
this.el.scrollTop = this.el.scrollHeight;
},
};
export default ScrollOnUpdate;