| @@ -11,47 +11,17 @@ | ||
| 11 | 11 | |
| 12 | 12 | var $page = wpgetapi.page(); |
| 13 | 13 | |
| 14 | 14 | wpgetapi.functionsHelp(); |
| 15 | - wpgetapi.tooltips(); | |
| 16 | - | |
| 15 | + | |
| 17 | 16 | $page |
| 18 | 17 | .on( 'click', '.functions .copy-this', wpgetapi.copyThis ) |
| 19 | 18 | .on( 'change keyup', '.field-id input', wpgetapi.functionsHelp ) |
| 20 | - .on( 'cmb2_remove_row cmb2_add_row cmb2_shift_row', wpgetapi.functionsHelp ) | |
| 21 | - .on( 'cmb2_add_row', wpgetapi.disableTestUntilSave ); | |
| 19 | + .on( 'cmb2_remove_row cmb2_add_row cmb2_shift_row', wpgetapi.functionsHelp ); | |
| 22 | 20 | |
| 23 | 21 | } |
| 24 | 22 | |
| 25 | - | |
| 26 | 23 | /** |
| 27 | - * Do the tooltips | |
| 28 | - */ | |
| 29 | - wpgetapi.tooltips = function () { | |
| 30 | - $( ".wrap.wpgetapi .dashicons-editor-help" ).tooltip({ | |
| 31 | - items: "[data-tip]", | |
| 32 | - content: function () { | |
| 33 | - return $(this).data("tip"); | |
| 34 | - }, | |
| 35 | - classes: { | |
| 36 | - "ui-tooltip": "wpgetapi-tooltip" | |
| 37 | - }, | |
| 38 | - position: { my: 'center bottom-10', at: 'center top' }, | |
| 39 | - close: function (event, ui) { | |
| 40 | - ui.tooltip.hover( | |
| 41 | - function () { | |
| 42 | - $(this).stop(true).fadeTo(400, 1); | |
| 43 | - }, | |
| 44 | - function () { | |
| 45 | - $(this).fadeOut("400", function () { | |
| 46 | - $(this).remove(); | |
| 47 | - }) | |
| 48 | - }); | |
| 49 | - } | |
| 50 | - }); | |
| 51 | - } | |
| 52 | - | |
| 53 | - /** | |
| 54 | 24 | * Copy the template tag or the shortcode |
| 55 | 25 | */ |
| 56 | 26 | wpgetapi.copyThis = function ( e ) { |
| 57 | 27 | |
| @@ -111,19 +81,8 @@ | ||
| 111 | 81 | |
| 112 | 82 | } |
| 113 | 83 | |
| 114 | 84 | } |
| 115 | - | |
| 116 | - | |
| 117 | - /** | |
| 118 | - * Disable the Test Endpoint button on adding new row. | |
| 119 | - * | |
| 120 | - */ | |
| 121 | - wpgetapi.disableTestUntilSave = function ( evt, row ) { | |
| 122 | - var $row = $( row ); | |
| 123 | - $row.find( '.wpgetapi .test-endpoint-button' ).attr( 'disabled', true ); | |
| 124 | - } | |
| 125 | - | |
| 126 | 85 | |
| 127 | 86 | /** |
| 128 | 87 | * Gets jQuery object containing all . Caches the result. |
| 129 | 88 | * |