Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -2935,6 +2935,23 @@ |
2936 | 2936 | }; |
2937 | 2937 | |
2938 | 2938 | // }}} |
| 2939 | + // {{{ toggleModal |
| 2940 | + |
| 2941 | + /** |
| 2942 | + * Toggles the modal state |
| 2943 | + * |
| 2944 | + * @param $link Element the feedback link |
| 2945 | + */ |
| 2946 | + $.articleFeedbackv5.toggleModal = function ( $link ) { |
| 2947 | + if ( $.articleFeedbackv5.inDialog ) { |
| 2948 | + $.articleFeedbackv5.closeAsModal(); |
| 2949 | + $.articleFeedbackv5.$dialog.dialog( 'close' ); |
| 2950 | + } else { |
| 2951 | + $.articleFeedbackv5.openAsModal( $link ); |
| 2952 | + } |
| 2953 | + }; |
| 2954 | + |
| 2955 | + // }}} |
2939 | 2956 | // {{{ setDialogDimensions |
2940 | 2957 | |
2941 | 2958 | /** |
— | — | @@ -2992,6 +3009,7 @@ |
2993 | 3010 | addToRemovalQueue: { args: 1, ret: false }, |
2994 | 3011 | openAsModal: { args: 1, ret: false }, |
2995 | 3012 | closeAsModal: { args: 0, ret: true }, |
| 3013 | + toggleModal: { args: 1, ret: false }, |
2996 | 3014 | trackClick: { args: 1, ret: false } |
2997 | 3015 | }; |
2998 | 3016 | if ( opts in public ) { |
Index: trunk/extensions/ArticleFeedbackv5/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.js |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | '-trigger' + $link.data( 'linkId' ) + |
26 | 26 | '-click-overlay'; |
27 | 27 | $aftDiv.articleFeedbackv5( 'trackClick', tracking_id ); |
28 | | - $aftDiv.articleFeedbackv5( 'openAsModal', $link ); |
| 28 | + $aftDiv.articleFeedbackv5( 'toggleModal', $link ); |
29 | 29 | }; |
30 | 30 | |
31 | 31 | // Bucketing |