PluginProbe
Edit Flow / 0.9.9
Edit Flow v0.9.9
0.11.1 0.11.0 0.7.2 0.7.3 0.7.4 0.7.5 0.7.6 0.8 0.8.1 0.8.2 0.9 0.9.1 0.9.2 0.9.3 0.9.4 0.9.5 0.9.6 0.9.7 0.9.8 0.9.9 trunk 0.1.5 0.10.0 0.10.1 0.10.2 All 44 releases
edit-flow / modules / story-budget / lib / story-budget.js

story-budget.js in Edit Flow 0.9.9, at modules/story-budget/lib/story-budget.js

47 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Story Budget specific JS, assumes that ef_date.js has already been included
2
3 jQuery( document ).ready( function ( $ ) {
4 // Make print link open up print dialog
5 $( '#print_link' ).on( 'click', function () {
6 window.print();
7 return false;
8 } );
9
10 // Hide a single section when directed
11 $( 'h3.hndle,div.handlediv' ).on( 'click', function () {
12 $( this ).parent().children( 'div.inside' ).toggle();
13 } );
14
15 // Change number of columns when choosing a new number from Screen Options
16
17 const columnsSwitch = $( 'input[name=ef_story_budget_screen_columns]' );
18 columnsSwitch.on( 'click', function () {
19 const numColumns = parseInt( $( this ).val() );
20 const classPrefix = 'columns-number-';
21 $( '.postbox-container' )
22 .removeClass( function () {
23 for ( var index = 1, c = []; index <= columnsSwitch.length; index++ ) {
24 c.push( classPrefix + index );
25 }
26 return c.join( ' ' );
27 } )
28 .addClass( classPrefix + numColumns );
29 } );
30
31 $( 'h2 a.change-date' ).on( 'click', function () {
32 $( this ).hide();
33 $( 'h2 form .form-value' ).hide();
34 $( 'h2 form input' ).show();
35 $( 'h2 form a.change-date-cancel' ).show();
36 return false;
37 } );
38
39 $( 'h2 form a.change-date-cancel' ).on( 'click', function () {
40 $( this ).hide();
41 $( 'h2 form .form-value' ).show();
42 $( 'h2 form input' ).hide();
43 $( 'h2 form a.change-date' ).show();
44 return false;
45 } );
46 } );
47