From 8dd9418d7e9aef40d81b04312ac6e10af5abee1b Mon Sep 17 00:00:00 2001
From: Yves Goergen
Date: Thu, 9 Mar 2023 18:04:57 +0100
Subject: [PATCH] dropdown() method expects target as option instead of first
parameter
---
doc/changes.html | 1 +
doc/frontfire-core.html | 5 +++--
doc/frontfire-ui-accordion.html | 4 ++--
doc/frontfire-ui-draggable.html | 20 ++++++++++----------
doc/frontfire-ui-dropdown.html | 12 +++++++++---
doc/frontfire-ui-resizable.html | 4 ++--
doc/frontfire-ui-sortable.html | 16 ++++++++--------
doc/frontfire-ui-table.html | 4 ++--
doc/frontfire-ui-tabs.html | 4 ++--
src/js/plugins/dropdown.js | 10 ++++++----
src/js/plugins/menu.js | 4 ++--
src/js/plugins/selectable.js | 3 ++-
src/js/plugins/timepicker.js | 2 +-
13 files changed, 50 insertions(+), 39 deletions(-)
diff --git a/doc/changes.html b/doc/changes.html
index 6230523..5432251 100644
--- a/doc/changes.html
+++ b/doc/changes.html
@@ -48,6 +48,7 @@ Breaking changes since v1
CSS class inverted-indicator
of the carousel removed, use the dark
and not-dark
theme classes instead
Off-canvas offcanvasopening
, offcanvasopen
, offcanvasclosing
, offcanvasclose
events renamed to opening
, open
, closing
, close
(similar to modal)
Removed undocumented styles for nav ul.menu
, modify the --menu-* CSS variables for that scope instead
+ The dropdown()
plugin method no longer accepts the target element as first parameter. Instead, the target property must be set in the options object. This removes the last inconsistency with Frontfire UI plugin methods that now all have a single options parameter. The target can now also be specified as CSS selector string, also from a data-opt HTML attribute.
diff --git a/doc/frontfire-core.html b/doc/frontfire-core.html
index cb8a13f..9830750 100644
--- a/doc/frontfire-core.html
+++ b/doc/frontfire-core.html
@@ -5120,11 +5120,12 @@ dropdown
Plugin: Dropdown
- dropdown(target, options)
→ Dropdown plugin instance
+ dropdown(options)
→ Dropdown plugin instance
Opens a dropdown with the selected element and places it at the specified target element.
- The target elements must already have the dropdown
CSS class, it is not added by this method.
+ The options must at least set a target element.
+ The dropdown element must already have the dropdown
CSS class, it is not added by this method.
See the plugin page for examples.
diff --git a/doc/frontfire-ui-accordion.html b/doc/frontfire-ui-accordion.html
index e8fdd71..56c9a17 100644
--- a/doc/frontfire-ui-accordion.html
+++ b/doc/frontfire-ui-accordion.html
@@ -337,8 +337,8 @@ Options
scrollOffsetElement |
- String, Node |
- Element whose height to consider when scrolling to an item, as CSS selector or Node. Both offsets are added. |
+ Node, String |
+ Element whose height to consider when scrolling to an item, as Node or CSS selector. Both offsets are added. |
None |
diff --git a/doc/frontfire-ui-draggable.html b/doc/frontfire-ui-draggable.html
index 2b8e6d6..9d2978c 100644
--- a/doc/frontfire-ui-draggable.html
+++ b/doc/frontfire-ui-draggable.html
@@ -289,20 +289,20 @@ Options
cancel |
- String, Node(s) |
- The element(s) that cannot start a drag operation, as CSS selector within the scope of the element to drag, or Node (collection). |
+ Node(s), String |
+ The element(s) that cannot start a drag operation, as Node (collection) or CSS selector within the scope of the element to drag. |
None |
catchElement |
- String, Node(s) |
- An element that catches all pointer input and moves the draggable to that point. Specified as CSS selector or Node (collection). |
+ Node(s), String |
+ An element that catches all pointer input and moves the draggable to that point. Specified as Node (collection) or CSS selector. |
None |
containment |
- String, Node(s) |
- Constrains the drag movement inside the specified element, specified as CSS selector or Node (collection), or the “parent” of the dragged element or the “viewport”. |
+ Node(s), String |
+ Constrains the drag movement inside the specified element, specified as Node (collection) or CSS selector, or the “parent” of the dragged element or the “viewport”. |
None |
@@ -325,8 +325,8 @@ Options
handle |
- String, Node(s) |
- The element(s) that can start a drag operation, as CSS selector within the scope of the element to drag, or Node (collection). |
+ Node(s), String |
+ The element(s) that can start a drag operation, as Node (collection) or CSS selector within the scope of the element to drag. |
The element to drag |
@@ -337,8 +337,8 @@ Options
stack |
- String, Node(s) |
- The elements among which the dragged element will be pulled to the front. Specified as CSS selector or Node (collection). |
+ Node(s), String |
+ The elements among which the dragged element will be pulled to the front. Specified as Node (collection) or CSS selector. |
None |
diff --git a/doc/frontfire-ui-dropdown.html b/doc/frontfire-ui-dropdown.html
index 7accf32..3dd876a 100644
--- a/doc/frontfire-ui-dropdown.html
+++ b/doc/frontfire-ui-dropdown.html
@@ -42,8 +42,8 @@ Description
To open a dropdown element, call the dropdown()
plugin function on the element to show as dropdown.
- The function takes the target placement element and options as arguments.
- The options are optional and can alternatively be specified as data-opt HTML attributes with the dropdown HTML element.
+ The function takes the options (including target placement element) as argument.
+ The options must at least set a target element and can alternatively be specified as data-opt HTML attributes with the dropdown HTML element.
Example
@@ -67,7 +67,7 @@ Dropdown title