r108483 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108482‎ | r108483 | r108484 >
Date:00:43, 10 January 2012
Author:rsterbin
Status:ok
Tags:
Comment:
Bug fix: Since link option D is accessible when you're in overlay mode, it
should work as a toggle rather than only opening the modal:
- modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js:
- New method toggleModal()
- Added toggleModal to the list of plugin-accessible methods
- modules/ext.articleFeedbackv5/ext.articleFeedbackv5.js:
- Switched the click method to use toggleModal() rather than
openAsModal()
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.js (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
@@ -2935,6 +2935,23 @@
29362936 };
29372937
29382938 // }}}
 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+ // }}}
29392956 // {{{ setDialogDimensions
29402957
29412958 /**
@@ -2992,6 +3009,7 @@
29933010 addToRemovalQueue: { args: 1, ret: false },
29943011 openAsModal: { args: 1, ret: false },
29953012 closeAsModal: { args: 0, ret: true },
 3013+ toggleModal: { args: 1, ret: false },
29963014 trackClick: { args: 1, ret: false }
29973015 };
29983016 if ( opts in public ) {
Index: trunk/extensions/ArticleFeedbackv5/modules/ext.articleFeedbackv5/ext.articleFeedbackv5.js
@@ -24,7 +24,7 @@
2525 '-trigger' + $link.data( 'linkId' ) +
2626 '-click-overlay';
2727 $aftDiv.articleFeedbackv5( 'trackClick', tracking_id );
28 - $aftDiv.articleFeedbackv5( 'openAsModal', $link );
 28+ $aftDiv.articleFeedbackv5( 'toggleModal', $link );
2929 };
3030
3131 // Bucketing

Follow-up revisions

RevisionCommit summaryAuthorDate
r108510Bug fix for r108483 -- no longer reloads the form every time you toggle the o...rsterbin15:46, 10 January 2012

Status & tagging log