diff --git a/entries/accordion.xml b/entries/accordion.xml index 1e593106..a5991340 100644 --- a/entries/accordion.xml +++ b/entries/accordion.xml @@ -39,8 +39,13 @@
ui-accordion
: The outer container of the accordion.
ui-accordion-header
: The headers of the accordion. The headers will additionally have a ui-accordion-icons
class if they contain icons
.ui-accordion-content
: The content panels of the accordion.ui-accordion-header
: The headers of the accordion. The active header will additionally have a ui-accordion-content-active
class, the inactive headers will have a ui-accordion-header-collapsed
class. The headers will also have a ui-accordion-icons
class if they contain icons
.
+ ui-accordion-header-icon
: Icon elements within each accordion header.ui-accordion-content
: The content panels of the accordion. The active content panel will additionally have a ui-accordion-content-active
class.false
, will prevent the ui-droppable
class from being added. This may be desired as a performance optimization when calling .droppable()
init on hundreds of elements.true
, any parent droppables will not receive the element. The drop
event will still bubble normally, but the event.target
can be checked to see which droppable received the draggable element.Additional (thematic) classes to add to the widget, in addition to the structural classes. The structural classes are used as keys of this option and the thematic classes are the values. See the _addClass()
method for using this in custom widgets. Check out the documentation of individual widgets to see which classes they support.
The primary motivation of this option is to map structural classes to theme classes. In other words, any class prefixed with namespace and widget, like "ui-progressbar-"
, is considered a structural class. These are always added to the widget. In contrast to that, any class not specific to the widget is considered a theme class. These could be part of jQuery UI's CSS framework, but can also come from other CSS frameworks or be defined in custom stylesheets.
Setting the classes
option after creation will override all default properties. To only change specific values, use deep setters, e.g. .option( "classes.ui-progressbar-value", null )
.
classes
option specified, changing the theming for the ui-progressbar
class:
+$( ".selector" ).progressbar({
+ classes: {
+ "ui-progressbar": "highlight"
+ }
+});
+
+ classes
option, after initialization:
+// Getter
+var classes = $( ".selector" ).widget( "option", "classes" );
+
+// Setter, override all classes
+$( ".selector" ).widget( "option", "classes", { "custom-header": "icon-warning" } );
+
+// Setter, override just one class
+$( ".selector" ).widget( "option", "classes.custom-header", "icon-warning" );
+
+ This provides a hook for the user to add additional classes or replace default styling classes, through the classes
option.
It also provides automatic removal of these classes when a widget is destroyed, as long as you're using _addClass()
, _removeClass()
and _toggleClass()
together. This can heavily simplify the implementation of custom _destroy()
methods.
this.element
.classes
option matches a key, the value will be added as well.
+ When you only need the extra
argument, you can skip this argument by specifying null
.
keys
argument, these aren't associated with any properties of the classes
option. Just like keys
, they will also be automatically removed when destroying the widget.ui-progressbar
class to the widget's element (this.element
). Will also add any additional classes specified through the classes
option for the given class.
+ demo-popup-header
class to the specified element (here referencing this.popup
). Will also add any additional classes specified through the classes
option for the given class. In addition, it will always add the ui-front
class.
+ ui-helper-hidden-accessible
class to the specified element. Uses null
for the keys
argument to skip it.
+ The arguments are the same as for the _addClass()
method, the same semantics apply, just in reverse.
this.element
.classes
option matches a key, the value will be removed as well.
+ When you only need the extra
argument, you can skip this argument by specifying null
.
keys
argument, these aren't associated with any properties of the classes
option.ui-progressbar
class from the widget's element (this.element
). Will also remove any additional classes specified through the classes
option for the given class.
+ demo-popup-header
class from the specified element (here referencing this.popup
). Will also remove any additional classes specified through the classes
option for the given class. In addition, it will also remove the ui-front
class.
+ ui-helper-hidden-accessible
class from the specified element. Uses null
for the keys
argument to skip it.
+ The arguments are the same as for the _addClass()
and _removeClass()
methods, except for the additional boolean argument that specifies to add or remove classes.
Unlike jQuery's .toggleClass()
method, the boolean add
argument is always required.
this.element
.classes
option matches a key, the value will be toggled as well.
+ When you only need the extra
argument, you can skip this argument by specifying null
.
keys
argument, these aren't associated with any properties of the classes
option. Just like keys
, they will also be automatically removed when destroying the widget.Indicates whether to add or remove the specified classes, where a boolean true
indicates that classes should be added, a boolean false
indicates that classes should be removed.
ui-state-disabled
class on the widget's element (this.element
).
+ _create()
method is the widget's constructor.
diff --git a/entries/menu.xml b/entries/menu.xml
index b1ecd4cc..d5a19ea0 100644
--- a/entries/menu.xml
+++ b/entries/menu.xml
@@ -90,13 +90,13 @@
ui-menu
: The outer container of the menu. This element will additionally have a ui-menu-icons
class if the menu contains icons.
+ ui-menu
: The outer container of the menu, as well as any nested submenu. This top-level element will additionally have a ui-menu-icons
class if the menu contains icons.
ui-menu-item
: The container for individual menu items.
+ ui-menu-item
: The container for individual menu items. This contains the element for the item's text itself as well as the element for submenus.
ui-menu-item-wrapper
: The wrapper element inside each individual menu item.
+ ui-menu-item-wrapper
: The wrapper element inside each individual menu item, containting the text content and the icon indicating submenus.
ui-menu-icon
: The submenu icons set via the icons
option.ui-progressbar
: The outer container of the progressbar. This element will additionally have a class of ui-progressbar-indeterminate
for indeterminate progressbars.
+ ui-progressbar
: The outer container of the progressbar. This element will additionally have a class of ui-progressbar-indeterminate
for indeterminate progressbars. For determinate progressbars, the ui-progressbar-complete
class is added once the maximum value is reached.
ui-progressbar-value
: The element that represents the filled portion of the progressbar.
@@ -35,6 +35,15 @@
The jQuery UI Resizable plugin makes selected elements resizable (meaning they have draggable resize handles). You can specify one or more handles as well as min and max width and height.
+ui-resizable
: The resizable element. During a resize, the ui-resizable-resizing
class is added. When the autoHide
option is set, the ui-resizable-autohide
class is added.ui-resizable-handle
: One of the handles of the resizable, specified using the handles
option. Each handle will also have a ui-resizable-{direction}
class according to its position.ui-resizable-ghost
: When using the ghost
option, this class is applied to the ghost helper element.ui-resizable-helper
: When the animate
option is used, but the helper
option isn't specified, this class is added to the generated helper."parent"
and "document"
.The jQuery UI Selectable plugin allows for elements to be selected by dragging a box (sometimes called a lasso) with the mouse over the elements. Elements can also be selected via click or drag while holding the ctrl/meta key, allowing for multiple (non-contiguous) selections.
+ui-selectable
: The selectable element.
+ ui-selectee
: One of the selectable elements, as specified through the filter
option. This element can also receive one of the following classes: ui-selecting
(when the lasso includes this element), ui-selected
(after a successful selection), ui-unselecting
(when the lasso lost this element).ui-selectable-helper
: The "lasso" element used to visualize the ongoing selection.ALT
/OPTION
+ UP
/DOWN
: Toggle the visibility of the menu.SPACE
: Open the menu.ui-selectmenu-button
: The button-like element replacing the native selectmenu on the page. Has the ui-selectmenu-button-closed
class when closed, the ui-selectmenu-button-open
class when open.
+ ui-selectmenu-text
: The span representing the text portion of the button element.ui-selectmenu-icon-space
: A supporting element between the text and the icon of the selectmenu button.ui-selectmenu-menu
: The wrapper element around the menu used to display options to the user (not the menu itself). When the menu is open, the ui-selectmenu-open
class is added.
+ ui-selectmenu-optgroup
: One of the elements that replicates <optgroup>
elements from native selects.null
, the parents of the <select>
are checked for a class name of ui-front
. If an element with the ui-front
class name is found, the menu is appended to that element. Regardless of the value, if no element is found, the menu is appended to the body.ui-slider
: The track of the slider control. This element will additionally have a class name of ui-slider-horizontal
or ui-slider-vertical
depending on the orientation
of the slider.
+ ui-slider
: The track of the slider control. This element will additionally have a class name of ui-slider-horizontal
or ui-slider-vertical
depending on the orientation
option of the slider.
ui-slider-handle
: The slider handles.ui-slider-range
: The selected range used when the range
option is set. This element can additionally have a class of ui-slider-range-min
or ui-slider-range-max
if the range
option is set to "min"
or "max"
respectively.ui-slider-handle
: One of the slider handles.ui-slider-range
: The selected range used when the range
option is set. This element can additionally have a class of ui-slider-range-min
or ui-slider-range-max
if the range
option is set to "min"
or "max"
respectively.The jQuery UI Sortable plugin makes selected elements sortable by dragging with the mouse.
Note: In order to sort table rows, the tbody
must be made sortable, not the table
.
ui-sortable
: The sortable element.
+ ui-sortable-handle
: The handle of each sortable item, specified using the handle
option. By default, each sortable item itself is also the handle.ui-sortable-placeholder
: The element used to show the future position of the item currently being sorted.ui-sortable-helper
: The element shown while dragging a sortable item. The element actually used depends on the helper
option.connectWith
option must be set on both sortable elements.null
, the currently set culture in Globalize
is used, see Globalize docs for available cultures. Only relevant if the numberFormat
option is set. Requires Globalize to be included.ui-tabs
: The outer container of the tabs. This element will additionally have a class of ui-tabs-collapsible
when the collapsible
option is set.
+ ui-tabs
: The outer container of the tabs. This element will additionally have a class of ui-tabs-collapsible
when the collapsible
option is set.
ui-tabs-nav
: The list of tabs.
ui-tabs-active
class. Any list item whose associated content is loading via an Ajax call will have a ui-tabs-loading
class.
+ ui-tabs-tab
: One of the items in the list of tabs.The active item will have the ui-tabs-active
class. Any list item whose associated content is loading via an Ajax call will have the ui-tabs-loading
class.
ui-tabs-anchor
: The anchors used to switch panels.true
, the active panel can be closed.The content of the tooltip.
@@ -76,7 +83,7 @@This may get replaced by the classes option.
diff --git a/includes/classes-option-desc.xml b/includes/classes-option-desc.xml new file mode 100644 index 00000000..78662b0b --- /dev/null +++ b/includes/classes-option-desc.xml @@ -0,0 +1,4 @@ + +Specify additional classes to add to the widget's elements. Any of classes specified in the Theming section can be used as keys to override their value. To learn more about this option, check out the learn article about the classes
option.
classes
option specified, changing the theming for the ui-
class:
+$( ".selector" ). ({
+ classes: {
+ "ui- ": "highlight"
+ }
+});
+
+ classes
option, after initialization, here reading and changing the theming for the ui-
class:
+// Getter
+var themeClass = $( ".selector" ). ( "option", "classes.ui- " );
+
+// Setter
+$( ".selector" ). ( "option", "classes.ui- ", "highlight" );
+
+ The
The classes
option: