Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
41491108
Commit
41491108
authored
Apr 29, 2010
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#777738
by Garrett Albright: Fixed #states: Correct spelling of Dependent.
parent
31f13b56
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc/states.js
+10
-10
10 additions, 10 deletions
misc/states.js
with
10 additions
and
10 deletions
misc/states.js
+
10
−
10
View file @
41491108
...
@@ -19,7 +19,7 @@ Drupal.behaviors.states = {
...
@@ -19,7 +19,7 @@ Drupal.behaviors.states = {
attach
:
function
(
context
,
settings
)
{
attach
:
function
(
context
,
settings
)
{
for
(
var
selector
in
settings
.
states
)
{
for
(
var
selector
in
settings
.
states
)
{
for
(
var
state
in
settings
.
states
[
selector
])
{
for
(
var
state
in
settings
.
states
[
selector
])
{
new
states
.
Depend
a
nt
({
new
states
.
Depend
e
nt
({
element
:
$
(
selector
),
element
:
$
(
selector
),
state
:
states
.
State
.
sanitize
(
state
),
state
:
states
.
State
.
sanitize
(
state
),
dependees
:
settings
.
states
[
selector
][
state
]
dependees
:
settings
.
states
[
selector
][
state
]
...
@@ -39,12 +39,12 @@ Drupal.behaviors.states = {
...
@@ -39,12 +39,12 @@ Drupal.behaviors.states = {
*
*
* @param args
* @param args
* Object with the following keys (all of which are required):
* Object with the following keys (all of which are required):
* - element: A jQuery object of the depend
a
nt element
* - element: A jQuery object of the depend
e
nt element
* - state: A State object describing the state that is depend
a
nt
* - state: A State object describing the state that is depend
e
nt
* - dependees: An object with dependency specifications. Lists all elements
* - dependees: An object with dependency specifications. Lists all elements
* that this element depends on.
* that this element depends on.
*/
*/
states
.
Depend
a
nt
=
function
(
args
)
{
states
.
Depend
e
nt
=
function
(
args
)
{
$
.
extend
(
this
,
{
values
:
{},
oldValue
:
undefined
},
args
);
$
.
extend
(
this
,
{
values
:
{},
oldValue
:
undefined
},
args
);
for
(
var
selector
in
this
.
dependees
)
{
for
(
var
selector
in
this
.
dependees
)
{
...
@@ -57,7 +57,7 @@ states.Dependant = function (args) {
...
@@ -57,7 +57,7 @@ states.Dependant = function (args) {
* specification from the dependency settings. If the object type can't be
* specification from the dependency settings. If the object type can't be
* found in this list, the === operator is used by default.
* found in this list, the === operator is used by default.
*/
*/
states
.
Depend
a
nt
.
comparisons
=
{
states
.
Depend
e
nt
.
comparisons
=
{
'
RegExp
'
:
function
(
reference
,
value
)
{
'
RegExp
'
:
function
(
reference
,
value
)
{
return
reference
.
test
(
value
);
return
reference
.
test
(
value
);
},
},
...
@@ -67,9 +67,9 @@ states.Dependant.comparisons = {
...
@@ -67,9 +67,9 @@ states.Dependant.comparisons = {
}
}
};
};
states
.
Depend
a
nt
.
prototype
=
{
states
.
Depend
e
nt
.
prototype
=
{
/**
/**
* Initializes one of the elements this depend
a
nt depends on.
* Initializes one of the elements this depend
e
nt depends on.
*
*
* @param selector
* @param selector
* The CSS selector describing the dependee.
* The CSS selector describing the dependee.
...
@@ -111,9 +111,9 @@ states.Dependant.prototype = {
...
@@ -111,9 +111,9 @@ states.Dependant.prototype = {
* true, undefined or false.
* true, undefined or false.
*/
*/
compare
:
function
(
reference
,
value
)
{
compare
:
function
(
reference
,
value
)
{
if
(
reference
.
constructor
.
name
in
states
.
Depend
a
nt
.
comparisons
)
{
if
(
reference
.
constructor
.
name
in
states
.
Depend
e
nt
.
comparisons
)
{
// Use a custom compare function for certain reference value types.
// Use a custom compare function for certain reference value types.
return
states
.
Depend
a
nt
.
comparisons
[
reference
.
constructor
.
name
](
reference
,
value
);
return
states
.
Depend
e
nt
.
comparisons
[
reference
.
constructor
.
name
](
reference
,
value
);
}
}
else
{
else
{
// Do a plain comparison otherwise.
// Do a plain comparison otherwise.
...
@@ -228,7 +228,7 @@ states.Trigger.prototype = {
...
@@ -228,7 +228,7 @@ states.Trigger.prototype = {
* This list of states contains functions that are used to monitor the state
* This list of states contains functions that are used to monitor the state
* of an element. Whenever an element depends on the state of another element,
* of an element. Whenever an element depends on the state of another element,
* one of these trigger functions is added to the dependee so that the
* one of these trigger functions is added to the dependee so that the
* depend
a
nt element can be updated.
* depend
e
nt element can be updated.
*/
*/
states
.
Trigger
.
states
=
{
states
.
Trigger
.
states
=
{
// 'empty' describes the state to be monitored
// 'empty' describes the state to be monitored
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment