Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
59b1bac3
Commit
59b1bac3
authored
Dec 01, 2017
by
xjm
Browse files
Revert "Issue
#2915784
by dawehner, drpal, justafish, tedbow, xjm: 1/3 JS codestyle: camelcase"
This reverts commit
9b874acf
.
parent
42634ef6
Changes
16
Hide whitespace changes
Inline
Side-by-side
core/misc/machine-name.es6.js
View file @
59b1bac3
...
...
@@ -86,11 +86,11 @@
}
}
Object
.
keys
(
settings
.
machineName
).
forEach
((
source
I
d
)
=>
{
Object
.
keys
(
settings
.
machineName
).
forEach
((
source
_i
d
)
=>
{
let
machine
=
''
;
const
options
=
settings
.
machineName
[
source
I
d
];
const
options
=
settings
.
machineName
[
source
_i
d
];
const
$source
=
$context
.
find
(
source
I
d
).
addClass
(
'
machine-name-source
'
).
once
(
'
machine-name
'
);
const
$source
=
$context
.
find
(
source
_i
d
).
addClass
(
'
machine-name-source
'
).
once
(
'
machine-name
'
);
const
$target
=
$context
.
find
(
options
.
target
).
addClass
(
'
machine-name-target
'
);
const
$suffix
=
$context
.
find
(
options
.
suffix
);
const
$wrapper
=
$target
.
closest
(
'
.js-form-item
'
);
...
...
core/misc/machine-name.js
View file @
59b1bac3
...
...
@@ -49,11 +49,11 @@
}
}
Object
.
keys
(
settings
.
machineName
).
forEach
(
function
(
source
I
d
)
{
Object
.
keys
(
settings
.
machineName
).
forEach
(
function
(
source
_i
d
)
{
var
machine
=
''
;
var
options
=
settings
.
machineName
[
source
I
d
];
var
options
=
settings
.
machineName
[
source
_i
d
];
var
$source
=
$context
.
find
(
source
I
d
).
addClass
(
'
machine-name-source
'
).
once
(
'
machine-name
'
);
var
$source
=
$context
.
find
(
source
_i
d
).
addClass
(
'
machine-name-source
'
).
once
(
'
machine-name
'
);
var
$target
=
$context
.
find
(
options
.
target
).
addClass
(
'
machine-name-target
'
);
var
$suffix
=
$context
.
find
(
options
.
suffix
);
var
$wrapper
=
$target
.
closest
(
'
.js-form-item
'
);
...
...
core/misc/vertical-tabs.es6.js
View file @
59b1bac3
...
...
@@ -61,7 +61,7 @@
$
(
context
).
find
(
'
[data-vertical-tabs-panes]
'
).
once
(
'
vertical-tabs
'
).
each
(
function
()
{
const
$this
=
$
(
this
).
addClass
(
'
vertical-tabs__panes
'
);
const
focusID
=
$this
.
find
(
'
:hidden.vertical-tabs__active-tab
'
).
val
();
let
tab
F
ocus
;
let
tab
_f
ocus
;
// Check if there are some details that can be converted to
// vertical-tabs.
...
...
@@ -71,45 +71,45 @@
}
// Create the tab column.
const
tab
L
ist
=
$
(
'
<ul class="vertical-tabs__menu"></ul>
'
);
$this
.
wrap
(
'
<div class="vertical-tabs clearfix"></div>
'
).
before
(
tab
L
ist
);
const
tab
_l
ist
=
$
(
'
<ul class="vertical-tabs__menu"></ul>
'
);
$this
.
wrap
(
'
<div class="vertical-tabs clearfix"></div>
'
).
before
(
tab
_l
ist
);
// Transform each details into a tab.
$details
.
each
(
function
()
{
const
$that
=
$
(
this
);
const
vertical
T
ab
=
new
Drupal
.
verticalTab
({
const
vertical
_t
ab
=
new
Drupal
.
verticalTab
({
title
:
$that
.
find
(
'
> summary
'
).
text
(),
details
:
$that
,
});
tab
L
ist
.
append
(
vertical
T
ab
.
item
);
tab
_l
ist
.
append
(
vertical
_t
ab
.
item
);
$that
.
removeClass
(
'
collapsed
'
)
// prop() can't be used on browsers not supporting details element,
// the style won't apply to them if prop() is used.
.
attr
(
'
open
'
,
true
)
.
addClass
(
'
vertical-tabs__pane
'
)
.
data
(
'
verticalTab
'
,
vertical
T
ab
);
.
data
(
'
verticalTab
'
,
vertical
_t
ab
);
if
(
this
.
id
===
focusID
)
{
tab
F
ocus
=
$that
;
tab
_f
ocus
=
$that
;
}
});
$
(
tab
L
ist
).
find
(
'
> li
'
).
eq
(
0
).
addClass
(
'
first
'
);
$
(
tab
L
ist
).
find
(
'
> li
'
).
eq
(
-
1
).
addClass
(
'
last
'
);
$
(
tab
_l
ist
).
find
(
'
> li
'
).
eq
(
0
).
addClass
(
'
first
'
);
$
(
tab
_l
ist
).
find
(
'
> li
'
).
eq
(
-
1
).
addClass
(
'
last
'
);
if
(
!
tab
F
ocus
)
{
if
(
!
tab
_f
ocus
)
{
// If the current URL has a fragment and one of the tabs contains an
// element that matches the URL fragment, activate that tab.
const
$locationHash
=
$this
.
find
(
window
.
location
.
hash
);
if
(
window
.
location
.
hash
&&
$locationHash
.
length
)
{
tab
F
ocus
=
$locationHash
.
closest
(
'
.vertical-tabs__pane
'
);
tab
_f
ocus
=
$locationHash
.
closest
(
'
.vertical-tabs__pane
'
);
}
else
{
tab
F
ocus
=
$this
.
find
(
'
> .vertical-tabs__pane
'
).
eq
(
0
);
tab
_f
ocus
=
$this
.
find
(
'
> .vertical-tabs__pane
'
).
eq
(
0
);
}
}
if
(
tab
F
ocus
.
length
)
{
tab
F
ocus
.
data
(
'
verticalTab
'
).
focus
();
if
(
tab
_f
ocus
.
length
)
{
tab
_f
ocus
.
data
(
'
verticalTab
'
).
focus
();
}
});
},
...
...
core/misc/vertical-tabs.js
View file @
59b1bac3
...
...
@@ -26,42 +26,42 @@
$
(
context
).
find
(
'
[data-vertical-tabs-panes]
'
).
once
(
'
vertical-tabs
'
).
each
(
function
()
{
var
$this
=
$
(
this
).
addClass
(
'
vertical-tabs__panes
'
);
var
focusID
=
$this
.
find
(
'
:hidden.vertical-tabs__active-tab
'
).
val
();
var
tab
F
ocus
=
void
0
;
var
tab
_f
ocus
=
void
0
;
var
$details
=
$this
.
find
(
'
> details
'
);
if
(
$details
.
length
===
0
)
{
return
;
}
var
tab
L
ist
=
$
(
'
<ul class="vertical-tabs__menu"></ul>
'
);
$this
.
wrap
(
'
<div class="vertical-tabs clearfix"></div>
'
).
before
(
tab
L
ist
);
var
tab
_l
ist
=
$
(
'
<ul class="vertical-tabs__menu"></ul>
'
);
$this
.
wrap
(
'
<div class="vertical-tabs clearfix"></div>
'
).
before
(
tab
_l
ist
);
$details
.
each
(
function
()
{
var
$that
=
$
(
this
);
var
vertical
T
ab
=
new
Drupal
.
verticalTab
({
var
vertical
_t
ab
=
new
Drupal
.
verticalTab
({
title
:
$that
.
find
(
'
> summary
'
).
text
(),
details
:
$that
});
tab
L
ist
.
append
(
vertical
T
ab
.
item
);
$that
.
removeClass
(
'
collapsed
'
).
attr
(
'
open
'
,
true
).
addClass
(
'
vertical-tabs__pane
'
).
data
(
'
verticalTab
'
,
vertical
T
ab
);
tab
_l
ist
.
append
(
vertical
_t
ab
.
item
);
$that
.
removeClass
(
'
collapsed
'
).
attr
(
'
open
'
,
true
).
addClass
(
'
vertical-tabs__pane
'
).
data
(
'
verticalTab
'
,
vertical
_t
ab
);
if
(
this
.
id
===
focusID
)
{
tab
F
ocus
=
$that
;
tab
_f
ocus
=
$that
;
}
});
$
(
tab
L
ist
).
find
(
'
> li
'
).
eq
(
0
).
addClass
(
'
first
'
);
$
(
tab
L
ist
).
find
(
'
> li
'
).
eq
(
-
1
).
addClass
(
'
last
'
);
$
(
tab
_l
ist
).
find
(
'
> li
'
).
eq
(
0
).
addClass
(
'
first
'
);
$
(
tab
_l
ist
).
find
(
'
> li
'
).
eq
(
-
1
).
addClass
(
'
last
'
);
if
(
!
tab
F
ocus
)
{
if
(
!
tab
_f
ocus
)
{
var
$locationHash
=
$this
.
find
(
window
.
location
.
hash
);
if
(
window
.
location
.
hash
&&
$locationHash
.
length
)
{
tab
F
ocus
=
$locationHash
.
closest
(
'
.vertical-tabs__pane
'
);
tab
_f
ocus
=
$locationHash
.
closest
(
'
.vertical-tabs__pane
'
);
}
else
{
tab
F
ocus
=
$this
.
find
(
'
> .vertical-tabs__pane
'
).
eq
(
0
);
tab
_f
ocus
=
$this
.
find
(
'
> .vertical-tabs__pane
'
).
eq
(
0
);
}
}
if
(
tab
F
ocus
.
length
)
{
tab
F
ocus
.
data
(
'
verticalTab
'
).
focus
();
if
(
tab
_f
ocus
.
length
)
{
tab
_f
ocus
.
data
(
'
verticalTab
'
).
focus
();
}
});
}
...
...
core/modules/block/js/block.admin.es6.js
View file @
59b1bac3
...
...
@@ -24,7 +24,7 @@
attach
(
context
,
settings
)
{
const
$input
=
$
(
'
input.block-filter-text
'
).
once
(
'
block-filter-text
'
);
const
$table
=
$
(
$input
.
attr
(
'
data-element
'
));
let
$filter
R
ows
;
let
$filter
_r
ows
;
/**
* Filters the block list.
...
...
@@ -52,7 +52,7 @@
// Filter if the length of the query is at least 2 characters.
if
(
query
.
length
>=
2
)
{
$filter
R
ows
.
each
(
toggleBlockEntry
);
$filter
_r
ows
.
each
(
toggleBlockEntry
);
Drupal
.
announce
(
Drupal
.
formatPlural
(
$table
.
find
(
'
tr:visible
'
).
length
-
1
,
...
...
@@ -62,14 +62,14 @@
);
}
else
{
$filter
R
ows
.
each
(
function
(
index
)
{
$filter
_r
ows
.
each
(
function
(
index
)
{
$
(
this
).
parent
().
parent
().
show
();
});
}
}
if
(
$table
.
length
)
{
$filter
R
ows
=
$table
.
find
(
'
div.block-filter-text-source
'
);
$filter
_r
ows
=
$table
.
find
(
'
div.block-filter-text-source
'
);
$input
.
on
(
'
keyup
'
,
debounce
(
filterBlockList
,
200
));
}
},
...
...
core/modules/block/js/block.admin.js
View file @
59b1bac3
...
...
@@ -10,7 +10,7 @@
attach
:
function
attach
(
context
,
settings
)
{
var
$input
=
$
(
'
input.block-filter-text
'
).
once
(
'
block-filter-text
'
);
var
$table
=
$
(
$input
.
attr
(
'
data-element
'
));
var
$filter
R
ows
=
void
0
;
var
$filter
_r
ows
=
void
0
;
function
filterBlockList
(
e
)
{
var
query
=
$
(
e
.
target
).
val
().
toLowerCase
();
...
...
@@ -23,17 +23,17 @@
}
if
(
query
.
length
>=
2
)
{
$filter
R
ows
.
each
(
toggleBlockEntry
);
$filter
_r
ows
.
each
(
toggleBlockEntry
);
Drupal
.
announce
(
Drupal
.
formatPlural
(
$table
.
find
(
'
tr:visible
'
).
length
-
1
,
'
1 block is available in the modified list.
'
,
'
@count blocks are available in the modified list.
'
));
}
else
{
$filter
R
ows
.
each
(
function
(
index
)
{
$filter
_r
ows
.
each
(
function
(
index
)
{
$
(
this
).
parent
().
parent
().
show
();
});
}
}
if
(
$table
.
length
)
{
$filter
R
ows
=
$table
.
find
(
'
div.block-filter-text-source
'
);
$filter
_r
ows
=
$table
.
find
(
'
div.block-filter-text-source
'
);
$input
.
on
(
'
keyup
'
,
debounce
(
filterBlockList
,
200
));
}
}
...
...
core/modules/block/js/block.es6.js
View file @
59b1bac3
...
...
@@ -195,14 +195,14 @@
// Find the correct region and insert the row as the last in the
// region.
tableDrag
.
rowObject
=
new
tableDrag
.
row
(
row
[
0
]);
const
region
M
essage
=
table
.
find
(
`.region-
${
select
[
0
].
value
}
-message`
);
const
region
I
tems
=
region
M
essage
.
nextUntil
(
'
.region-message, .region-title
'
);
if
(
region
I
tems
.
length
)
{
region
I
tems
.
last
().
after
(
row
);
const
region
_m
essage
=
table
.
find
(
`.region-
${
select
[
0
].
value
}
-message`
);
const
region
_i
tems
=
region
_m
essage
.
nextUntil
(
'
.region-message, .region-title
'
);
if
(
region
_i
tems
.
length
)
{
region
_i
tems
.
last
().
after
(
row
);
}
// We found that region
M
essage is the last row.
// We found that region
_m
essage is the last row.
else
{
region
M
essage
.
after
(
row
);
region
_m
essage
.
after
(
row
);
}
updateBlockWeights
(
table
,
select
[
0
].
value
);
// Modify empty regions with added or removed fields.
...
...
core/modules/block/js/block.js
View file @
59b1bac3
...
...
@@ -119,12 +119,12 @@
var
select
=
$
(
this
);
tableDrag
.
rowObject
=
new
tableDrag
.
row
(
row
[
0
]);
var
region
M
essage
=
table
.
find
(
'
.region-
'
+
select
[
0
].
value
+
'
-message
'
);
var
region
I
tems
=
region
M
essage
.
nextUntil
(
'
.region-message, .region-title
'
);
if
(
region
I
tems
.
length
)
{
region
I
tems
.
last
().
after
(
row
);
var
region
_m
essage
=
table
.
find
(
'
.region-
'
+
select
[
0
].
value
+
'
-message
'
);
var
region
_i
tems
=
region
_m
essage
.
nextUntil
(
'
.region-message, .region-title
'
);
if
(
region
_i
tems
.
length
)
{
region
_i
tems
.
last
().
after
(
row
);
}
else
{
region
M
essage
.
after
(
row
);
region
_m
essage
.
after
(
row
);
}
updateBlockWeights
(
table
,
select
[
0
].
value
);
...
...
core/modules/content_translation/content_translation.admin.es6.js
View file @
59b1bac3
...
...
@@ -17,11 +17,10 @@
const
$context
=
$
(
context
);
const
options
=
drupalSettings
.
contentTranslationDependentOptions
;
let
$fields
;
let
dependentColumns
;
function
fieldsChangeHandler
(
$fields
,
dependent
C
olumns
)
{
function
fieldsChangeHandler
(
$fields
,
dependent
_c
olumns
)
{
return
function
(
e
)
{
Drupal
.
behaviors
.
contentTranslationDependentOptions
.
check
(
$fields
,
dependent
C
olumns
,
$
(
e
.
target
));
Drupal
.
behaviors
.
contentTranslationDependentOptions
.
check
(
$fields
,
dependent
_c
olumns
,
$
(
e
.
target
));
};
}
...
...
@@ -31,14 +30,14 @@
if
(
options
&&
options
.
dependent_selectors
)
{
Object
.
keys
(
options
.
dependent_selectors
).
forEach
((
field
)
=>
{
$fields
=
$context
.
find
(
`input[name^="
${
field
}
"]`
);
dependent
C
olumns
=
options
.
dependent_selectors
[
field
];
const
dependent
_c
olumns
=
options
.
dependent_selectors
[
field
];
$fields
.
on
(
'
change
'
,
fieldsChangeHandler
(
$fields
,
dependent
C
olumns
));
Drupal
.
behaviors
.
contentTranslationDependentOptions
.
check
(
$fields
,
dependent
C
olumns
);
$fields
.
on
(
'
change
'
,
fieldsChangeHandler
(
$fields
,
dependent
_c
olumns
));
Drupal
.
behaviors
.
contentTranslationDependentOptions
.
check
(
$fields
,
dependent
_c
olumns
);
});
}
},
check
(
$fields
,
dependent
C
olumns
,
$changed
)
{
check
(
$fields
,
dependent
_c
olumns
,
$changed
)
{
let
$element
=
$changed
;
let
column
;
...
...
@@ -48,8 +47,8 @@
// A field that has many different translatable parts can also define one
// or more columns that require all columns to be translatable.
Object
.
keys
(
dependent
C
olumns
).
forEach
((
index
)
=>
{
column
=
dependent
C
olumns
[
index
];
Object
.
keys
(
dependent
_c
olumns
).
forEach
((
index
)
=>
{
column
=
dependent
_c
olumns
[
index
];
if
(
!
$changed
)
{
$element
=
$fields
.
filter
(
filterFieldsList
);
...
...
core/modules/content_translation/content_translation.admin.js
View file @
59b1bac3
...
...
@@ -11,25 +11,24 @@
var
$context
=
$
(
context
);
var
options
=
drupalSettings
.
contentTranslationDependentOptions
;
var
$fields
=
void
0
;
var
dependentColumns
=
void
0
;
function
fieldsChangeHandler
(
$fields
,
dependent
C
olumns
)
{
function
fieldsChangeHandler
(
$fields
,
dependent
_c
olumns
)
{
return
function
(
e
)
{
Drupal
.
behaviors
.
contentTranslationDependentOptions
.
check
(
$fields
,
dependent
C
olumns
,
$
(
e
.
target
));
Drupal
.
behaviors
.
contentTranslationDependentOptions
.
check
(
$fields
,
dependent
_c
olumns
,
$
(
e
.
target
));
};
}
if
(
options
&&
options
.
dependent_selectors
)
{
Object
.
keys
(
options
.
dependent_selectors
).
forEach
(
function
(
field
)
{
$fields
=
$context
.
find
(
'
input[name^="
'
+
field
+
'
"]
'
);
dependent
C
olumns
=
options
.
dependent_selectors
[
field
];
var
dependent
_c
olumns
=
options
.
dependent_selectors
[
field
];
$fields
.
on
(
'
change
'
,
fieldsChangeHandler
(
$fields
,
dependent
C
olumns
));
Drupal
.
behaviors
.
contentTranslationDependentOptions
.
check
(
$fields
,
dependent
C
olumns
);
$fields
.
on
(
'
change
'
,
fieldsChangeHandler
(
$fields
,
dependent
_c
olumns
));
Drupal
.
behaviors
.
contentTranslationDependentOptions
.
check
(
$fields
,
dependent
_c
olumns
);
});
}
},
check
:
function
check
(
$fields
,
dependent
C
olumns
,
$changed
)
{
check
:
function
check
(
$fields
,
dependent
_c
olumns
,
$changed
)
{
var
$element
=
$changed
;
var
column
=
void
0
;
...
...
@@ -37,8 +36,8 @@
return
$
(
field
).
val
()
===
column
;
}
Object
.
keys
(
dependent
C
olumns
).
forEach
(
function
(
index
)
{
column
=
dependent
C
olumns
[
index
];
Object
.
keys
(
dependent
_c
olumns
).
forEach
(
function
(
index
)
{
column
=
dependent
_c
olumns
[
index
];
if
(
!
$changed
)
{
$element
=
$fields
.
filter
(
filterFieldsList
);
...
...
core/modules/editor/js/editor.es6.js
View file @
59b1bac3
...
...
@@ -14,10 +14,10 @@
* The text area DOM element, if it was found.
*/
function
findFieldForFormatSelector
(
$formatSelector
)
{
const
field
I
d
=
$formatSelector
.
attr
(
'
data-editor-for
'
);
const
field
_i
d
=
$formatSelector
.
attr
(
'
data-editor-for
'
);
// This selector will only find text areas in the top-level document. We do
// not support attaching editors on text areas within iframes.
return
$
(
`#
${
field
I
d
}
`
).
get
(
0
);
return
$
(
`#
${
field
_i
d
}
`
).
get
(
0
);
}
/**
...
...
core/modules/editor/js/editor.js
View file @
59b1bac3
...
...
@@ -7,9 +7,9 @@
(
function
(
$
,
Drupal
,
drupalSettings
)
{
function
findFieldForFormatSelector
(
$formatSelector
)
{
var
field
I
d
=
$formatSelector
.
attr
(
'
data-editor-for
'
);
var
field
_i
d
=
$formatSelector
.
attr
(
'
data-editor-for
'
);
return
$
(
'
#
'
+
field
I
d
).
get
(
0
);
return
$
(
'
#
'
+
field
_i
d
).
get
(
0
);
}
function
changeTextEditor
(
field
,
newFormatID
)
{
...
...
core/modules/menu_ui/menu_ui.es6.js
View file @
59b1bac3
...
...
@@ -43,41 +43,41 @@
// in the form, but play nicely with user permissions and form
// alterations.
const
$checkbox
=
$this
.
find
(
'
.js-form-item-menu-enabled input
'
);
const
$link
T
itle
=
$context
.
find
(
'
.js-form-item-menu-title input
'
);
const
$link
_t
itle
=
$context
.
find
(
'
.js-form-item-menu-title input
'
);
const
$title
=
$this
.
closest
(
'
form
'
).
find
(
'
.js-form-item-title-0-value input
'
);
// Bail out if we do not have all required fields.
if
(
!
(
$checkbox
.
length
&&
$link
T
itle
.
length
&&
$title
.
length
))
{
if
(
!
(
$checkbox
.
length
&&
$link
_t
itle
.
length
&&
$title
.
length
))
{
return
;
}
// If there is a link title already, mark it as overridden. The user
// expects that toggling the checkbox twice will take over the node's
// title.
if
(
$checkbox
.
is
(
'
:checked
'
)
&&
$link
T
itle
.
val
().
length
)
{
$link
T
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
,
true
);
if
(
$checkbox
.
is
(
'
:checked
'
)
&&
$link
_t
itle
.
val
().
length
)
{
$link
_t
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
,
true
);
}
// Whenever the value is changed manually, disable this behavior.
$link
T
itle
.
on
(
'
keyup
'
,
()
=>
{
$link
T
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
,
true
);
$link
_t
itle
.
on
(
'
keyup
'
,
()
=>
{
$link
_t
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
,
true
);
});
// Global trigger on checkbox (do not fill-in a value when disabled).
$checkbox
.
on
(
'
change
'
,
()
=>
{
if
(
$checkbox
.
is
(
'
:checked
'
))
{
if
(
!
$link
T
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
))
{
$link
T
itle
.
val
(
$title
.
val
());
if
(
!
$link
_t
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
))
{
$link
_t
itle
.
val
(
$title
.
val
());
}
}
else
{
$link
T
itle
.
val
(
''
);
$link
T
itle
.
removeData
(
'
menuLinkAutomaticTitleOverridden
'
);
$link
_t
itle
.
val
(
''
);
$link
_t
itle
.
removeData
(
'
menuLinkAutomaticTitleOverridden
'
);
}
$checkbox
.
closest
(
'
.vertical-tabs-pane
'
).
trigger
(
'
summaryUpdated
'
);
$checkbox
.
trigger
(
'
formUpdated
'
);
});
// Take over any title change.
$title
.
on
(
'
keyup
'
,
()
=>
{
if
(
!
$link
T
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
)
&&
$checkbox
.
is
(
'
:checked
'
))
{
$link
T
itle
.
val
(
$title
.
val
());
$link
T
itle
.
val
(
$title
.
val
()).
trigger
(
'
formUpdated
'
);
if
(
!
$link
_t
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
)
&&
$checkbox
.
is
(
'
:checked
'
))
{
$link
_t
itle
.
val
(
$title
.
val
());
$link
_t
itle
.
val
(
$title
.
val
()).
trigger
(
'
formUpdated
'
);
}
});
});
...
...
core/modules/menu_ui/menu_ui.js
View file @
59b1bac3
...
...
@@ -26,38 +26,38 @@
var
$this
=
$
(
this
);
var
$checkbox
=
$this
.
find
(
'
.js-form-item-menu-enabled input
'
);
var
$link
T
itle
=
$context
.
find
(
'
.js-form-item-menu-title input
'
);
var
$link
_t
itle
=
$context
.
find
(
'
.js-form-item-menu-title input
'
);
var
$title
=
$this
.
closest
(
'
form
'
).
find
(
'
.js-form-item-title-0-value input
'
);
if
(
!
(
$checkbox
.
length
&&
$link
T
itle
.
length
&&
$title
.
length
))
{
if
(
!
(
$checkbox
.
length
&&
$link
_t
itle
.
length
&&
$title
.
length
))
{
return
;
}
if
(
$checkbox
.
is
(
'
:checked
'
)
&&
$link
T
itle
.
val
().
length
)
{
$link
T
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
,
true
);
if
(
$checkbox
.
is
(
'
:checked
'
)
&&
$link
_t
itle
.
val
().
length
)
{
$link
_t
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
,
true
);
}
$link
T
itle
.
on
(
'
keyup
'
,
function
()
{
$link
T
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
,
true
);
$link
_t
itle
.
on
(
'
keyup
'
,
function
()
{
$link
_t
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
,
true
);
});
$checkbox
.
on
(
'
change
'
,
function
()
{
if
(
$checkbox
.
is
(
'
:checked
'
))
{
if
(
!
$link
T
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
))
{
$link
T
itle
.
val
(
$title
.
val
());
if
(
!
$link
_t
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
))
{
$link
_t
itle
.
val
(
$title
.
val
());
}
}
else
{
$link
T
itle
.
val
(
''
);
$link
T
itle
.
removeData
(
'
menuLinkAutomaticTitleOverridden
'
);
$link
_t
itle
.
val
(
''
);
$link
_t
itle
.
removeData
(
'
menuLinkAutomaticTitleOverridden
'
);
}
$checkbox
.
closest
(
'
.vertical-tabs-pane
'
).
trigger
(
'
summaryUpdated
'
);
$checkbox
.
trigger
(
'
formUpdated
'
);
});
$title
.
on
(
'
keyup
'
,
function
()
{
if
(
!
$link
T
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
)
&&
$checkbox
.
is
(
'
:checked
'
))
{
$link
T
itle
.
val
(
$title
.
val
());
$link
T
itle
.
val
(
$title
.
val
()).
trigger
(
'
formUpdated
'
);
if
(
!
$link
_t
itle
.
data
(
'
menuLinkAutomaticTitleOverridden
'
)
&&
$checkbox
.
is
(
'
:checked
'
))
{
$link
_t
itle
.
val
(
$title
.
val
());
$link
_t
itle
.
val
(
$title
.
val
()).
trigger
(
'
formUpdated
'
);
}
});
});
...
...
core/themes/bartik/color/preview.es6.js
View file @
59b1bac3
...
...
@@ -35,10 +35,10 @@
$colorPreview
.
find
(
'
.color-preview-footer-wrapper
'
).
css
(
'
background-color
'
,
$colorPalette
.
find
(
'
input[name="palette[footer]"]
'
).
val
());
// CSS3 Gradients.
const
gradient
S
tart
=
$colorPalette
.
find
(
'
input[name="palette[top]"]
'
).
val
();
const
gradient
E
nd
=
$colorPalette
.
find
(
'
input[name="palette[bottom]"]
'
).
val
();
const
gradient
_s
tart
=
$colorPalette
.
find
(
'
input[name="palette[top]"]
'
).
val
();
const
gradient
_e
nd
=
$colorPalette
.
find
(
'
input[name="palette[bottom]"]
'
).
val
();
$colorPreview
.
find
(
'
.color-preview-header
'
).
attr
(
'
style
'
,
`background-color:
${
gradient
S
tart
}
; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(
${
gradient
S
tart
}
), to(
${
gradient
E
nd
}
)); background-image: -moz-linear-gradient(-90deg,
${
gradient
S
tart
}
,
${
gradient
E
nd
}
);`
);
$colorPreview
.
find
(
'
.color-preview-header
'
).
attr
(
'
style
'
,
`background-color:
${
gradient
_s
tart
}
; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(
${
gradient
_s
tart
}
), to(
${
gradient
_e
nd
}
)); background-image: -moz-linear-gradient(-90deg,
${
gradient
_s
tart
}
,
${
gradient
_e
nd
}
);`
);
$colorPreview
.
find
(
'
.color-preview-site-name
'
).
css
(
'
color
'
,
$colorPalette
.
find
(
'
input[name="palette[titleslogan]"]
'
).
val
());
},
...
...
core/themes/bartik/color/preview.js
View file @
59b1bac3
...
...
@@ -32,10 +32,10 @@
$colorPreview
.
find
(
'
.color-preview-footer-wrapper
'
).
css
(
'
background-color
'
,
$colorPalette
.
find
(
'
input[name="palette[footer]"]
'
).
val
());
var
gradient
S
tart
=
$colorPalette
.
find
(
'
input[name="palette[top]"]
'
).
val
();
var
gradient
E
nd
=
$colorPalette
.
find
(
'
input[name="palette[bottom]"]
'
).
val
();
var
gradient
_s
tart
=
$colorPalette
.
find
(
'
input[name="palette[top]"]
'
).
val
();
var
gradient
_e
nd
=
$colorPalette
.
find
(
'
input[name="palette[bottom]"]
'
).
val
();
$colorPreview
.
find
(
'
.color-preview-header
'
).
attr
(
'
style
'
,
'
background-color:
'
+
gradient
S
tart
+
'
; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(
'
+
gradient
S
tart
+
'
), to(
'
+
gradient
E
nd
+
'
)); background-image: -moz-linear-gradient(-90deg,
'
+
gradient
S
tart
+
'
,
'
+
gradient
E
nd
+
'
);
'
);
$colorPreview
.
find
(
'
.color-preview-header
'
).
attr
(
'
style
'
,
'
background-color:
'
+
gradient
_s
tart
+
'
; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(
'
+
gradient
_s
tart
+
'
), to(
'
+
gradient
_e
nd
+
'
)); background-image: -moz-linear-gradient(-90deg,
'
+
gradient
_s
tart
+
'
,
'
+
gradient
_e
nd
+
'
);
'
);
$colorPreview
.
find
(
'
.color-preview-site-name
'
).
css
(
'
color
'
,
$colorPalette
.
find
(
'
input[name="palette[titleslogan]"]
'
).
val
());
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment