mirror of https://gitee.com/bigwinds/arangodb
show/hide database selector based on number of databases
This commit is contained in:
parent
4eb28f2ccb
commit
ba5d75afff
|
@ -355,6 +355,10 @@ $(document).ready(function() {
|
||||||
this.naviView.selectMenuItem('applications-menu');
|
this.naviView.selectMenuItem('applications-menu');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleSelectDatabase: function () {
|
||||||
|
this.naviView.handleSelectDatabase();
|
||||||
|
},
|
||||||
|
|
||||||
handleResize: function () {
|
handleResize: function () {
|
||||||
var oldWidth = $('#content').width();
|
var oldWidth = $('#content').width();
|
||||||
var containerWidth = $(window).width() - 70;
|
var containerWidth = $(window).width() - 70;
|
||||||
|
|
|
@ -157,14 +157,7 @@ window.databaseView = Backbone.View.extend({
|
||||||
this.collection.fetch({
|
this.collection.fetch({
|
||||||
success: function() {
|
success: function() {
|
||||||
self.render();
|
self.render();
|
||||||
var select = $("#dbSelectionList");
|
window.App.handleSelectDatabase();
|
||||||
select.empty();
|
|
||||||
self.collection.toJSON().forEach(function(item) {
|
|
||||||
select.append($("<option></option>")
|
|
||||||
.attr("value", item.name)
|
|
||||||
.text(item.name)
|
|
||||||
.attr("selected", item.name === this.currentDB));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,10 @@ var navigationView = Backbone.View.extend({
|
||||||
$('.nav-collapse').css('margin-right', margin - 10);
|
$('.nav-collapse').css('margin-right', margin - 10);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleSelectDatabase: function () {
|
||||||
|
this.dbSelectionView.render($("#selectDB"));
|
||||||
|
},
|
||||||
|
|
||||||
handleSelectNavigation: function () {
|
handleSelectNavigation: function () {
|
||||||
$("#arangoCollectionSelect").change(function() {
|
$("#arangoCollectionSelect").change(function() {
|
||||||
var navigateTo = $(this).find("option:selected").val();
|
var navigateTo = $(this).find("option:selected").val();
|
||||||
|
|
Loading…
Reference in New Issue