From bc44e61dd9e6797bb23bc3038d43436a8ba052c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 25 Oct 2012 06:19:25 -0400 Subject: [PATCH] Accordion: Removed change and changestart events. Fixes #6841 - Accordion: Remove changestart event. Fixes #6843 - Accordion: Remove change event. --- build/tasks/testswarm.js | 1 - tests/unit/accordion/accordion.html | 3 - .../accordion/accordion_common_deprecated.js | 22 --- .../unit/accordion/accordion_deprecated.html | 140 ------------------ tests/unit/accordion/accordion_deprecated.js | 99 ------------- tests/unit/all-active.html | 1 - tests/unit/all.html | 1 - tests/unit/subsuite.js | 1 - ui/jquery.ui.accordion.js | 38 ----- 9 files changed, 306 deletions(-) delete mode 100644 tests/unit/accordion/accordion_common_deprecated.js delete mode 100644 tests/unit/accordion/accordion_deprecated.html delete mode 100644 tests/unit/accordion/accordion_deprecated.js diff --git a/build/tasks/testswarm.js b/build/tasks/testswarm.js index 7219bcf0c..96e33b0f4 100644 --- a/build/tasks/testswarm.js +++ b/build/tasks/testswarm.js @@ -10,7 +10,6 @@ var versions = { }, tests = { "Accordion": "accordion/accordion.html", - "Accordion_deprecated": "accordion/accordion_deprecated.html", "Autocomplete": "autocomplete/autocomplete.html", "Button": "button/button.html", "Core": "core/core.html", diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html index b3b7caeae..4f40091bc 100644 --- a/tests/unit/accordion/accordion.html +++ b/tests/unit/accordion/accordion.html @@ -5,9 +5,6 @@ jQuery UI Accordion Test Suite - diff --git a/tests/unit/accordion/accordion_common_deprecated.js b/tests/unit/accordion/accordion_common_deprecated.js deleted file mode 100644 index 3b1e0f4fe..000000000 --- a/tests/unit/accordion/accordion_common_deprecated.js +++ /dev/null @@ -1,22 +0,0 @@ -TestHelpers.commonWidgetTests( "accordion", { - defaults: { - active: 0, - animate: {}, - collapsible: false, - disabled: false, - event: "click", - header: "> li > :first-child,> :not(li):even", - heightStyle: "auto", - icons: { - "activeHeader": "ui-icon-triangle-1-s", - "header": "ui-icon-triangle-1-e" - }, - - // callbacks - activate: null, - beforeActivate: null, - change: null, - changestart: null, - create: null - } -}); diff --git a/tests/unit/accordion/accordion_deprecated.html b/tests/unit/accordion/accordion_deprecated.html deleted file mode 100644 index dfb9fa90e..000000000 --- a/tests/unit/accordion/accordion_deprecated.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - jQuery UI Accordion Test Suite - - - - - - - - - - - - - - - - - - - - -

jQuery UI Accordion Test Suite

-

-
-

-
    -
    - -
    -

    There is one obvious advantage:

    -
    -

    - You've seen it coming! -
    - Buy now and get nothing for free! -
    - Well, at least no free beer. Perhaps a bear, if you can afford it. -

    -
    -

    Now that you've got...

    -
    -

    - your bear, you have to admit it! -
    - No, we aren't selling bears. -

    -

    - We could talk about renting one. -

    -
    -

    Rent one bear, ...

    -
    -

    - get two for three beer. -

    -

    - And now, for something completely different. -

    -
    -
    - - - -
    -
    - Accordion Header 1 -
    -
    - Accordion Content 1 -
    -
    - Accordion Header 2 -
    -
    - Accordion Content 2 -
    -
    - Accordion Header 3 -
    -
    - Accordion Content 3 -
    -
    - -
    - - diff --git a/tests/unit/accordion/accordion_deprecated.js b/tests/unit/accordion/accordion_deprecated.js deleted file mode 100644 index 57dabf418..000000000 --- a/tests/unit/accordion/accordion_deprecated.js +++ /dev/null @@ -1,99 +0,0 @@ -(function( $ ) { - -var equalHeight = TestHelpers.accordion.equalHeight, - setupTeardown = TestHelpers.accordion.setupTeardown, - state = TestHelpers.accordion.state; - -module( "accordion (deprecated) - changestart/change events", setupTeardown() ); - -test( "changestart", function() { - expect( 26 ); - var element = $( "#list1" ).accordion({ - active: false, - collapsible: true - }), - headers = element.find( ".ui-accordion-header" ), - content = element.find( ".ui-accordion-content" ); - - element.one( "accordionchangestart", function( event, ui ) { - equal( ui.oldHeader.length, 0 ); - equal( ui.oldContent.length, 0 ); - equal( ui.newHeader.length, 1 ); - strictEqual( ui.newHeader[ 0 ], headers[ 0 ] ); - equal( ui.newContent.length, 1 ); - strictEqual( ui.newContent[ 0 ], content[ 0 ] ); - state( element, 0, 0, 0 ); - }); - element.accordion( "option", "active", 0 ); - state( element, 1, 0, 0 ); - - element.one( "accordionchangestart", function( event, ui ) { - equal( ui.oldHeader.length, 1 ); - strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] ); - equal( ui.oldContent.length, 1 ); - strictEqual( ui.oldContent[ 0 ], content[ 0 ] ); - equal( ui.newHeader.length, 1 ); - strictEqual( ui.newHeader[ 0 ], headers[ 1 ] ); - equal( ui.newContent.length, 1 ); - strictEqual( ui.newContent[ 0 ], content[ 1 ] ); - state( element, 1, 0, 0 ); - }); - headers.eq( 1 ).click(); - state( element, 0, 1, 0 ); - - element.one( "accordionchangestart", function( event, ui ) { - equal( ui.oldHeader.length, 1 ); - strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] ); - equal( ui.oldContent.length, 1 ); - strictEqual( ui.oldContent[ 0 ], content[ 1 ] ); - equal( ui.newHeader.length, 0 ); - equal( ui.newContent.length, 0 ); - state( element, 0, 1, 0 ); - }); - element.accordion( "option", "active", false ); - state( element, 0, 0, 0 ); -}); - -test( "change", function() { - expect( 20 ); - var element = $( "#list1" ).accordion({ - active: false, - collapsible: true - }), - headers = element.find( ".ui-accordion-header" ), - content = element.find( ".ui-accordion-content" ); - - element.one( "accordionchange", function( event, ui ) { - equal( ui.oldHeader.length, 0 ); - equal( ui.oldContent.length, 0 ); - equal( ui.newHeader.length, 1 ); - strictEqual( ui.newHeader[ 0 ], headers[ 0 ] ); - equal( ui.newContent.length, 1 ); - strictEqual( ui.newContent[ 0 ], content[ 0 ] ); - }); - element.accordion( "option", "active", 0 ); - - element.one( "accordionchange", function( event, ui ) { - equal( ui.oldHeader.length, 1 ); - strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] ); - equal( ui.oldContent.length, 1 ); - strictEqual( ui.oldContent[ 0 ], content[ 0 ] ); - equal( ui.newHeader.length, 1 ); - strictEqual( ui.newHeader[ 0 ], headers[ 1 ] ); - equal( ui.newContent.length, 1 ); - strictEqual( ui.newContent[ 0 ], content[ 1 ] ); - }); - headers.eq( 1 ).click(); - - element.one( "accordionchange", function( event, ui ) { - equal( ui.oldHeader.length, 1 ); - strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] ); - equal( ui.oldContent.length, 1 ); - strictEqual( ui.oldContent[ 0 ], content[ 1 ] ); - equal( ui.newHeader.length, 0 ); - equal( ui.newContent.length, 0 ); - }); - element.accordion( "option", "active", false ); -}); - -})(jQuery); diff --git a/tests/unit/all-active.html b/tests/unit/all-active.html index f842aa5cc..236411475 100644 --- a/tests/unit/all-active.html +++ b/tests/unit/all-active.html @@ -17,7 +17,6 @@ var params = [], suites = [ "accordion/accordion.html", - "accordion/accordion_deprecated.html", "autocomplete/autocomplete.html", "button/button.html", "core/core.html", diff --git a/tests/unit/all.html b/tests/unit/all.html index bc204c976..e8dac887c 100644 --- a/tests/unit/all.html +++ b/tests/unit/all.html @@ -17,7 +17,6 @@ var params = [], suites = [ "accordion/accordion.html", - "accordion/accordion_deprecated.html", "autocomplete/autocomplete.html", "button/button.html", "core/core.html", diff --git a/tests/unit/subsuite.js b/tests/unit/subsuite.js index 6238cb2b1..b583bbd75 100644 --- a/tests/unit/subsuite.js +++ b/tests/unit/subsuite.js @@ -7,7 +7,6 @@ var versions = [ "git" ], additionalTests = { - accordion: [ "accordion_deprecated.html" ], position: [ "position_deprecated.html" ] }; diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 6ec85b681..b22f0c4e2 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -540,42 +540,4 @@ $.widget( "ui.accordion", { } }); - - -// DEPRECATED -if ( $.uiBackCompat !== false ) { - // change events - (function( $, prototype ) { - $.extend( prototype.options, { - change: null, - changestart: null - }); - - var _trigger = prototype._trigger; - prototype._trigger = function( type, event, data ) { - var ret = _trigger.apply( this, arguments ); - if ( !ret ) { - return false; - } - - if ( type === "beforeActivate" ) { - ret = _trigger.call( this, "changestart", event, { - oldHeader: data.oldHeader, - oldContent: data.oldPanel, - newHeader: data.newHeader, - newContent: data.newPanel - }); - } else if ( type === "activate" ) { - ret = _trigger.call( this, "change", event, { - oldHeader: data.oldHeader, - oldContent: data.oldPanel, - newHeader: data.newHeader, - newContent: data.newPanel - }); - } - return ret; - }; - }( jQuery, jQuery.ui.accordion.prototype ) ); -} - })( jQuery ); -- 2.39.5