diff options
| author | LV-426 <lv-426@taproot.org.il> | 2015-05-18 18:24:15 +0300 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2015-05-18 18:33:11 +0300 |
| commit | 22dc319d4bb62aa1bb045313b869b8581ac6a916 (patch) | |
| tree | eeaf4aa3065e0017e28ec181b1c5f1962f4e860b /src/client/view | |
| parent | 16a056303efba94281d82ed963b92fce9c3d9daf (diff) | |
view/toolbar__status: refactoring out view
Diffstat (limited to 'src/client/view')
| -rw-r--r-- | src/client/view/toolbar__status.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/client/view/toolbar__status.js b/src/client/view/toolbar__status.js new file mode 100644 index 00000000..a0c5cef0 --- /dev/null +++ b/src/client/view/toolbar__status.js @@ -0,0 +1,45 @@ +"use strict" + +/** + * Manage backend websocket connection + */ +define(['jquery'], +function($) { + + var close_btn, + toolbar__status; + + function toolbar__status() { + + close_btn = $('<div>x</div>'); + close_btn.addClass('toolbar__close_btn'); + + toolbar__status = $('#status-bar'); + toolbar__status.append(close_btn); + } + + /** + * display given HTML fragment as status line body + */ + function display_html_frag(toolbar__status_body) { + toolbar__status.children().remove(); + + toolbar__status.append(close_btn); + toolbar__status.append(toolbar__status_body); + toolbar__status_body.addClass('status-bar__body'); + + close_btn.click(function() { + toolbar__status.hide(); + }); + + toolbar__status.show(); + } + + toolbar__status(); + + return { + display_html_frag : display_html_frag, + hide: toolbar__status.hide + }; + +}); |
