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/button.js') 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: " -

CSS

diff --git a/demos/button/splitbutton.html b/demos/button/splitbutton.html deleted file mode 100644 index 6b7562d68..000000000 --- a/demos/button/splitbutton.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - jQuery UI Button - Split button - - - - - - - - - - - - - -
-
- - -
-
    -
  • Open...
  • -
  • Save
  • -
  • Delete
  • -
-
- -
-

An example of a split button built with two buttons: A plain button with just text, one with only a primary icon -and no text. Both are grouped together in a set.

-
- - diff --git a/demos/button/toolbar.html b/demos/button/toolbar.html deleted file mode 100644 index f2c242f1f..000000000 --- a/demos/button/toolbar.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - jQuery UI Button - Toolbar - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- -
-

- A mediaplayer toolbar. Take a look at the underlying markup: A few button elements, - an input of type checkbox for the Shuffle button, and three inputs of type radio for the Repeat options. -

-
- - diff --git a/demos/checkboxradio/default.html b/demos/checkboxradio/default.html index c8f4c5566..c8c1a800d 100644 --- a/demos/checkboxradio/default.html +++ b/demos/checkboxradio/default.html @@ -4,17 +4,12 @@ jQuery UI Checkboxradio - Default functionality - - - - - + diff --git a/demos/checkboxradio/no-icons.html b/demos/checkboxradio/no-icons.html index 64b511246..c738d8ca8 100644 --- a/demos/checkboxradio/no-icons.html +++ b/demos/checkboxradio/no-icons.html @@ -4,17 +4,12 @@ jQuery UI Checkboxradio - No Icons - - - - - + diff --git a/demos/checkboxradio/product-selector.html b/demos/checkboxradio/product-selector.html index f8da07118..4e6db4507 100644 --- a/demos/checkboxradio/product-selector.html +++ b/demos/checkboxradio/product-selector.html @@ -4,14 +4,9 @@ jQuery UI Checkboxradio - Product Selector - - - - - - +