r107913 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107912‎ | r107913 | r107914 >
Date:18:03, 3 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/REL1_18/phase3 (modified) (history)
  • /branches/REL1_18/phase3/resources/jquery/jquery.collapsibleTabs.js (modified) (history)
  • /branches/REL1_18/phase3/resources/jquery/jquery.delayedBind.js (modified) (history)
  • /branches/REL1_18/phase3/tests/qunit/index.html (modified) (history)
  • /branches/REL1_18/phase3/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js (added) (history)

Diff [purge]

Index: branches/REL1_18/phase3/tests/qunit/index.html
@@ -43,6 +43,7 @@
4444 <script src="../../resources/jquery/jquery.byteLength.js"></script>
4545 <script src="../../resources/jquery/jquery.byteLimit.js"></script>
4646 <script src="../../resources/jquery/jquery.colorUtil.js"></script>
 47+ <script src="../../resources/jquery/jquery.delayedBind.js"></script>
4748 <script src="../../resources/jquery/jquery.getAttrs.js"></script>
4849 <script src="../../resources/jquery/jquery.localize.js"></script>
4950 <script src="../../resources/jquery/jquery.tabIndex.js"></script>
@@ -69,6 +70,7 @@
7071 <script src="suites/resources/jquery/jquery.byteLength.js"></script>
7172 <script src="suites/resources/jquery/jquery.byteLimit.js"></script>
7273 <script src="suites/resources/jquery/jquery.colorUtil.js"></script>
 74+ <script src="suites/resources/jquery/jquery.delayedBind.test.js"></script>
7375 <script src="suites/resources/jquery/jquery.getAttrs.js"></script>
7476 <script src="suites/resources/jquery/jquery.localize.js"></script>
7577 <script src="suites/resources/jquery/jquery.tabIndex.js"></script>
Index: branches/REL1_18/phase3/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js
@@ -0,0 +1,41 @@
 2+test('jquery.delayedBind with data option', function() {
 3+ var $fixture = $('<div>').appendTo('body'),
 4+ data = { magic: "beeswax" },
 5+ delay = 50;
 6+
 7+ $fixture.delayedBind(delay, 'testevent', data, function(event) {
 8+ start(); // continue!
 9+ ok(true, 'testevent fired');
 10+ ok(event.data === data, 'data is passed through delayedBind');
 11+ });
 12+
 13+ expect(2);
 14+ stop(); // async!
 15+
 16+ // We'll trigger it thrice, but it should only happen once.
 17+ $fixture.trigger('testevent', {});
 18+ $fixture.trigger('testevent', {});
 19+ $fixture.trigger('testevent', {});
 20+ $fixture.trigger('testevent', {});
 21+});
 22+
 23+test('jquery.delayedBind without data option', function() {
 24+ var $fixture = $('<div>').appendTo('body'),
 25+ data = { magic: "beeswax" },
 26+ delay = 50;
 27+
 28+ $fixture.delayedBind(delay, 'testevent', function(event) {
 29+ start(); // continue!
 30+ ok(true, 'testevent fired');
 31+ });
 32+
 33+ expect(1);
 34+ stop(); // async!
 35+
 36+ // We'll trigger it thrice, but it should only happen once.
 37+ $fixture.trigger('testevent', {});
 38+ $fixture.trigger('testevent', {});
 39+ $fixture.trigger('testevent', {});
 40+ $fixture.trigger('testevent', {});
 41+});
 42+
Property changes on: branches/REL1_18/phase3/tests/qunit/suites/resources/jquery/jquery.delayedBind.test.js
___________________________________________________________________
Added: svn:eol-style
143 + native
Index: branches/REL1_18/phase3/resources/jquery/jquery.collapsibleTabs.js
@@ -24,7 +24,7 @@
2525 // if we haven't already bound our resize hanlder, bind it now
2626 if( !$.collapsibleTabs.boundEvent ) {
2727 $( window )
28 - .delayedBind( '500', 'resize', null, function( ) { $.collapsibleTabs.handleResize(); } );
 28+ .delayedBind( '500', 'resize', function( ) { $.collapsibleTabs.handleResize(); } );
2929 }
3030 // call our resize handler to setup the page
3131 $.collapsibleTabs.handleResize();
Index: branches/REL1_18/phase3/resources/jquery/jquery.delayedBind.js
@@ -19,6 +19,11 @@
2020 * @param callback Function to call
2121 */
2222 delayedBind: function( timeout, event, data, callback ) {
 23+ if ( arguments.length == 3 ) {
 24+ // Shift optional parameter down
 25+ callback = data;
 26+ data = undefined;
 27+ }
2328 var encEvent = encodeEvent( event );
2429 return this.each( function() {
2530 var that = this;
Property changes on: branches/REL1_18/phase3
___________________________________________________________________
Modified: svn:mergeinfo
2631 Merged /trunk/phase3:r105007

Follow-up revisions

RevisionCommit summaryAuthorDate
r107957Merge r107913 (merges r105007 from trunk) and r107924 (merges r106992 from tr...reedy22:57, 3 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105007Followup r104671: fix regression in jquery.delayedBind() due to change in par...brion21:47, 2 December 2011

Status & tagging log