1
0
Fork 0

show/hide database selector depending on number of dbs available

This commit is contained in:
Jan Steemann 2013-11-13 23:40:53 +01:00
parent 9f340c10d5
commit 922e4f35bf
4 changed files with 12 additions and 1 deletions

View File

@ -346,6 +346,10 @@ $(document).ready(function() {
this.naviView.selectMenuItem('applications-menu');
},
handleSelectDatabase: function () {
this.naviView.handleSelectDatabase();
},
handleResize: function () {
var oldWidth = $('#content').width();
var containerWidth = $(window).width() - 70;

View File

@ -157,6 +157,8 @@ window.databaseView = Backbone.View.extend({
this.collection.fetch({
success: function() {
self.render();
window.App.handleSelectDatabase();
/*
var select = $("#dbSelectionList");
select.empty();
self.collection.toJSON().forEach(function(item) {
@ -165,6 +167,7 @@ window.databaseView = Backbone.View.extend({
.text(item.name)
.attr("selected", item.name === this.currentDB));
});
*/
}
});
}

View File

@ -10,7 +10,7 @@
},
initialize: function() {
var self = this;
var self = this;
this.collection.fetch({
success: function(){
self.render(self.$el);

View File

@ -26,6 +26,10 @@
$('.nav-collapse').css('margin-right', margin - 10);
},
handleSelectDatabase: function () {
this.dbSelectionView.render($("#selectDB"));
},
handleSelectNavigation: function () {
$("#arangoCollectionSelect").change(function() {
var navigateTo = $(this).find("option:selected").val();