Sha256: 617c7a33336b4e0b24341d5534ced2f73c4c5fd631098264d0eaa61665c9ea10

Contents?: true

Size: 1.42 KB

Versions: 3

Compression:

Stored size: 1.42 KB

Contents

$(function () {
  // just playing
  $( '#confirm-db-deletion').hide();
  $( '#user-dialog').hide();

  // using the localStorage to store the state of the Info/Docs/Indexes TABs
  var lastTab = localStorage.getItem('lastTabSelected');
  if (lastTab) {
    $('#'+lastTab).tab('show');
    $('div.tab-content').children().removeClass('active in');
    $('#'+lastTab+'-tab').addClass('active in');
  }else{
    $('#collections-info').tab('show');
    $('#collections-info-tab').addClass('active in');
  }

  $('a[data-toggle="tab"]').on('click', function (e) {
    var id = $(e.target).attr('id');
    localStorage.setItem('lastTabSelected', id);
    $('div.tab-content').children().removeClass('active in');
    $(id+'-tab').addClass('active in');    
  });

  $('a.delete-user').live('click', function () {
      _id = $(this).data('id');
      _user_name = $(this).data('user-name');
      _db_name = $(this).data('db-name');

      $('#confirm-delete-user').modal({
          backdrop:true,
          keyboard:true
      });

      $('#delete-dialog-title').html("Delete '" + _user_name + "'?");
      $('#confirm-delete-user .username').attr('value', _user_name);
      $('#confirm-delete-user .primary').attr('action', '/databases/' + _db_name + '/users');
  });


  
  $('#add-collection').live('click', function() {
    $('#new-collection-dialog .primary').attr('action', '/databases/' + 
      $(this).data('db-name') + '/collections');
  });  
});

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongo_fe-0.1.2 lib/mongo_fe/public/js/db-tools.js
mongo_fe-0.1.1 lib/mongo_fe/public/js/db-tools.js
mongo_fe-0.1.0 lib/mongo_fe/public/js/db-tools.js