Reworked top menu. Started upgrading to bootstrap 3.
[arvados.git] / apps / workbench / app / assets / javascripts / application.js
1 // This is a manifest file that'll be compiled into application.js, which will include all the files
2 // listed below.
3 //
4 // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6 //
7 // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 // the compiled file.
9 //
10 // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11 // GO AFTER THE REQUIRES BELOW.
12 //
13 //= require jquery
14 //= require jquery_ujs
15 //= require bootstrap
16 //= require bootstrap/dropdown
17 //= require bootstrap-editable
18 //= require bootstrap-editable-rails
19 //= require_tree .
20
21 jQuery(function($){
22     $.ajaxSetup({
23         headers: {
24             'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
25         }
26     });
27     $('.editable').editable();
28     $('[data-toggle=tooltip]').tooltip();
29
30     $('.expand-collapse-row').on('click', function(event) {
31         var targets = $('#' + $(this).attr('data-id'));
32         if (targets.css('display') == 'none') {
33             $(this).addClass('icon-minus-sign');
34             $(this).removeClass('icon-plus-sign');
35         } else {
36             $(this).addClass('icon-plus-sign');
37             $(this).removeClass('icon-minus-sign');
38         }
39         targets.fadeToggle(200);
40     });
41     $(document).
42         on('ajax:send', function(e, xhr) {
43             $('.loading').show();
44         }).
45         on('ajax:complete', function(e, status) {
46             $('.loading').hide();
47         });
48 })(jQuery);