Merge branch '1636-inactive-user' into 1678-new-active-user-orientation
[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 twitter/bootstrap
16 //= require bootstrap-editable
17 //= require bootstrap-editable-rails
18 //= require_tree .
19
20 jQuery(function($){
21     $.ajaxSetup({
22         headers: {
23             'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
24         }
25     });
26     $('.editable').editable();
27     $('[data-toggle=tooltip]').tooltip();
28
29     $('.expand-collapse-row').on('click', function(event) {
30         var targets = $('#' + $(this).attr('data-id'));
31         if (targets.css('display') == 'none') {
32             $(this).addClass('icon-minus-sign');
33             $(this).removeClass('icon-plus-sign');
34         } else {
35             $(this).addClass('icon-plus-sign');
36             $(this).removeClass('icon-minus-sign');
37         }
38         targets.fadeToggle(200);
39     });
40 })(jQuery);