forked from moderntribe/tampermonkey-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
issue-list-tools.user.js
46 lines (40 loc) · 1.22 KB
/
issue-list-tools.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// ==UserScript==
// @name Issue list tools
// @namespace https://central.tri.be/
// @version 0.1
// @description Adds tools to interact with the issue list
// @author Matthew Batchelder
// @include /https?:\/\/central(dev)?.tri.be.*\/issues/
// @grant none
// ==/UserScript==
( function( $ ) {
'use strict';
var obj = {};
/**
* Initializes the clocking nav
*/
obj.init = function() {
var $issueList = $( document.getElementById( 'issue-list' ) );
$issueList.before( '<div class="tribe-row-tools"><a href="#" class="collapse-row-groups">Toggle row groups</a></div>' );
$( document ).on( 'click', '.collapse-row-groups', function( e ) {
e.preventDefault();
$( '.expander' ).click();
} );
obj.buildStyles();
};
/**
* Adds CSS for clocking tracker
*/
obj.buildStyles = function() {
$( 'head' ).append( '<style id="tribe-issue-list-tools-styles"/>' );
obj.$styles = $( document.getElementById( 'tribe-issue-list-tools-styles' ) );
obj.$styles.html( `
.tribe-row-tools {
padding: .5rem 0;
}
` );
};
$( function() {
obj.init();
} );
})( jQuery );