diff --git a/js/apps/system/aardvark/frontend/css/dbSelectionView.css b/js/apps/system/aardvark/frontend/css/dbSelectionView.css index f4deadedb8..91e057b929 100644 --- a/js/apps/system/aardvark/frontend/css/dbSelectionView.css +++ b/js/apps/system/aardvark/frontend/css/dbSelectionView.css @@ -1,12 +1,8 @@ -span.selectDB { - top: 6px; - left: 210px; - position: absolute; -} - span.selectDB > select { line-height: 20px; height: 20px; width: 150px; - padding: 0px; + margin: -3px 0px 2px 0px; + border-radius: 0px !important; + border: 1px solid; } diff --git a/js/apps/system/aardvark/frontend/js/routers/router.js b/js/apps/system/aardvark/frontend/js/routers/router.js index 8945e81443..183de137ba 100644 --- a/js/apps/system/aardvark/frontend/js/routers/router.js +++ b/js/apps/system/aardvark/frontend/js/routers/router.js @@ -69,10 +69,6 @@ this.graphView = new window.GraphView({ collection: window.arangoCollectionsStore }); - this.dbSelectionView = new window.DBSelectionView({ - collection: window.arangoDatabase, - current: window.currentDB - }); var self = this; $(window).resize(function() { @@ -343,7 +339,7 @@ }, handleSelectDatabase: function () { - this.dbSelectionView.render($("#selectDB")); + this.footerView.handleSelectDatabase(); }, handleResize: function () { diff --git a/js/apps/system/aardvark/frontend/js/templates/dbSelectionView.ejs b/js/apps/system/aardvark/frontend/js/templates/dbSelectionView.ejs index 0988045d52..67179d4e79 100644 --- a/js/apps/system/aardvark/frontend/js/templates/dbSelectionView.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/dbSelectionView.ejs @@ -12,5 +12,9 @@ if (list.length > 1) { %> <% +} else { +%> + <%=current%> +<% } %> diff --git a/js/apps/system/aardvark/frontend/js/templates/footerView.ejs b/js/apps/system/aardvark/frontend/js/templates/footerView.ejs index 4da97d2617..b96f9cf6ca 100644 --- a/js/apps/system/aardvark/frontend/js/templates/footerView.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/footerView.ejs @@ -12,6 +12,6 @@ diff --git a/js/apps/system/aardvark/frontend/js/views/dbSelectionView.js b/js/apps/system/aardvark/frontend/js/views/dbSelectionView.js index e218abc1bf..df9debf6ac 100644 --- a/js/apps/system/aardvark/frontend/js/views/dbSelectionView.js +++ b/js/apps/system/aardvark/frontend/js/views/dbSelectionView.js @@ -4,8 +4,6 @@ "use strict"; window.DBSelectionView = Backbone.View.extend({ - el: "#dbSelect", - template: templateEngine.createTemplate("dbSelectionView.ejs"), events: { @@ -16,9 +14,7 @@ var self = this; this.current = opts.current; this.collection.fetch({ - success: function() { - self.render(); - } + async: false }); }, @@ -28,13 +24,14 @@ window.location.replace(url); }, - render: function() { - $(this.el).html(this.template.render({ + render: function(el) { + this.$el = el; + this.$el.html(this.template.render({ list: this.collection, current: this.current.get("name") })); this.delegateEvents(); - return $(this.el); + return this.el; } }); }()); diff --git a/js/apps/system/aardvark/frontend/js/views/footerView.js b/js/apps/system/aardvark/frontend/js/views/footerView.js index 81ac2bd8c7..e086233400 100644 --- a/js/apps/system/aardvark/frontend/js/views/footerView.js +++ b/js/apps/system/aardvark/frontend/js/views/footerView.js @@ -11,6 +11,10 @@ initialize: function () { //also server online check var self = this; + this.dbSelectionView = new window.DBSelectionView({ + collection: window.arangoDatabase, + current: window.currentDB + }); window.setInterval(function(){ self.getVersion(); }, 15000); @@ -90,6 +94,7 @@ }, renderVersion: function () { + var self = this; if (this.system.hasOwnProperty('database') && this.system.hasOwnProperty('name')) { $(this.el).html(this.template.render({ name: this.system.name, @@ -97,11 +102,7 @@ database: this.system.database, margin: this.resizeMargin })); - /* - var tag = 'Server: ' + this.system.name + ' ' + this.system.version + - ', Database: ' + this.system.database; - $('.footer-right p').html(tag); - */ + this.dbSelectionView.render($("#dbSelect")); } }, @@ -110,7 +111,12 @@ this.render(); }, + handleSelectDatabase: function() { + this.dbSelectionView.render(); + }, + render: function () { + var self = this; if (!this.system.version) { this.getVersion(); } @@ -120,6 +126,7 @@ database: this.system.database, margin: this.resizeMargin })); + this.dbSelectionView.render($("#dbSelect")); return this; } diff --git a/js/apps/system/aardvark/frontend/js/views/navigationView.js b/js/apps/system/aardvark/frontend/js/views/navigationView.js index f564fdd344..5a0b3580f7 100644 --- a/js/apps/system/aardvark/frontend/js/views/navigationView.js +++ b/js/apps/system/aardvark/frontend/js/views/navigationView.js @@ -18,9 +18,8 @@ }, handleResize: function (margin) { - $('.arango-logo').css('margin-left', margin - 17); - $("#dbSelect").css('margin-left', margin - 17); - $('.nav-collapse').css('margin-right', margin - 10); + $('.arango-logo').css('margin-left', margin - 41); + $('.nav-collapse').css('margin-right', margin + 7); }, diff --git a/js/apps/system/aardvark/index.html b/js/apps/system/aardvark/index.html index 4938a63193..6de7868158 100644 --- a/js/apps/system/aardvark/index.html +++ b/js/apps/system/aardvark/index.html @@ -20,7 +20,6 @@