Changeset 2329
- Timestamp:
- 01/19/2016 08:50:21 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/javascript/payment-requests.js
r2328 r2329 1 1 jQuery( document ).ready( function( $ ) { 2 2 'use strict'; 3 // todo add try/catch and log4 3 5 4 var wcb = window.WordCampBudgets; … … 10 9 */ 11 10 init: function () { 12 app.registerEventHandlers(); 13 wcb.attachedFilesView = new wcb.AttachedFilesView(); 14 wcb.setupDatePicker( '#wcp_general_info' ); 11 try { 12 app.registerEventHandlers(); 13 wcb.attachedFilesView = new wcb.AttachedFilesView(); 14 wcb.setupDatePicker( '#wcp_general_info' ); 15 } catch ( exception ) { 16 wcb.log( exception ); 17 } 15 18 }, 16 19 … … 32 35 */ 33 36 toggleOtherCategoryDescription : function( event ) { 34 var otherCategoryDescription = $( '#row-other-category-explanation' ); 37 try { 38 var otherCategoryDescription = $( '#row-other-category-explanation' ); 35 39 36 if ( 'other' == $( this ).find( 'option:selected' ).val() ) { 37 $( otherCategoryDescription ).removeClass( 'hidden' ); 38 } else { 39 $( otherCategoryDescription ).addClass( 'hidden' ); 40 if ( 'other' == $( this ).find( 'option:selected' ).val() ) { 41 $( otherCategoryDescription ).removeClass( 'hidden' ); 42 } else { 43 $( otherCategoryDescription ).addClass( 'hidden' ); 44 } 45 46 // todo make the transition smoother 47 } catch ( exception ) { 48 wcb.log( exception ); 40 49 } 41 42 // todo make the transition smoother43 50 }, 44 51 45 52 /** 46 53 * Require notes when the request is being marked as incomplete 54 * 55 * @param {object} event 47 56 */ 48 requireNotes : function() { 49 var notes = $( '#wcp_mark_incomplete_notes' ); 57 requireNotes : function( event ) { 58 try { 59 var notes = $( '#wcp_mark_incomplete_notes' ); 50 60 51 if ( 'checked' === $( '#wcp_mark_incomplete_checkbox' ).attr( 'checked' ) ) { 52 notes.attr( 'required', true ); 53 } else { 54 notes.attr( 'required', false ); 61 if ( 'checked' === $( '#wcp_mark_incomplete_checkbox' ).attr( 'checked' ) ) { 62 notes.attr( 'required', true ); 63 } else { 64 notes.attr( 'required', false ); 65 } 66 } catch ( exception ) { 67 wcb.log( exception ); 55 68 } 56 69 }
Note: See TracChangeset
for help on using the changeset viewer.