-Editor.prototype.setupUI = function() {
- // set up the UI visually and attach callbacks
- var self = this;
-
- self.rootDiv.makeHorizPanel({}); // TODO: this probably doesn't belong into jQuery
- // self.rootDiv.css('top', ($('#header').outerHeight() ) + 'px');
-
- $('#panels > *.panel-wrap').each(function() {
- var panelWrap = $(this);
- $.log('wrap: ', panelWrap);
- var panel = new Panel(panelWrap);
- panelWrap.data('ctrl', panel); // attach controllers to wraps
- panel.load($('.panel-toolbar select', panelWrap).val());
-
- $('.panel-toolbar select', panelWrap).change(function() {
- var url = $(this).val();
- panelWrap.data('ctrl').load(url);
- self.savePanelOptions();
- });
-
- $('.panel-toolbar button.refresh-button', panelWrap).click(
- function() {
- panel.refresh();
- } );
- });
-
- $(document).bind('panel:contentChanged', function() {
- self.onContentChanged.apply(self, arguments)
- });
-
- $('#toolbar-button-save').click( function (event, data) {
- self.saveToBranch();
- } );
- $('#toolbar-button-commit').click( function (event, data) {
- self.sendPullRequest();
- } );
- self.rootDiv.bind('stopResize', function() {
- self.savePanelOptions()
- });
-}
-