From 02033262ee0fb1d9f33c361b3c2ddfa168604854 Mon Sep 17 00:00:00 2001 From: Alexander Schmitz Date: Wed, 22 Jan 2014 12:02:32 -0500 Subject: Button: Initial commit of button re-factor Move to using element stats rather then js class states remove ui-button-text spans. Removed button set --- ui/widgets/button.js | 597 ++++++++++++++++++++++++--------------------------- 1 file changed, 278 insertions(+), 319 deletions(-) (limited to 'ui/widgets') diff --git a/ui/widgets/button.js b/ui/widgets/button.js index 94fc75331..34a2afa40 100644 --- a/ui/widgets/button.js +++ b/ui/widgets/button.js @@ -22,10 +22,13 @@ // AMD. Register as an anonymous module. define( [ "jquery", - "../data", + + // These are only for backcompat + // TODO: Remove after 1.12 + "./controlgroup", + "./checkboxradio", + "../keycode", - "../labels", - "../version", "../widget" ], factory ); } else { @@ -35,391 +38,347 @@ } }( function( $ ) { -var lastActive, - baseClasses = "ui-button ui-widget ui-state-default ui-corner-all", - typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only", - formResetHandler = function() { - var form = $( this ); - setTimeout( function() { - form.find( ":ui-button" ).button( "refresh" ); - }, 1 ); - }, - radioGroup = function( radio ) { - var name = radio.name, - form = radio.form, - radios = $( [] ); - if ( name ) { - name = name.replace( /'/g, "\\'" ); - if ( form ) { - radios = $( form ).find( "[name='" + name + "'][type=radio]" ); - } else { - radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument ) - .filter( function() { - return !this.form; - } ); - } - } - return radios; - }; - $.widget( "ui.button", { version: "@VERSION", defaultElement: "