Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
82f8f24d
Commit
82f8f24d
authored
Sep 27, 2013
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2095225
by nod_, pameeela: Fixed Scrolling is broken on modals.
parent
ab6961d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
16 deletions
+21
-16
core/misc/dialog.js
core/misc/dialog.js
+20
-13
core/modules/ckeditor/js/ckeditor.js
core/modules/ckeditor/js/ckeditor.js
+1
-3
No files found.
core/misc/dialog.js
View file @
82f8f24d
...
@@ -10,10 +10,12 @@
...
@@ -10,10 +10,12 @@
drupalSettings
.
dialog
=
{
drupalSettings
.
dialog
=
{
autoOpen
:
true
,
autoOpen
:
true
,
// This option will turn off resizable and draggable.
autoResize
:
true
,
autoResize
:
true
,
maxHeight
:
'
95%
'
,
dialogClass
:
''
,
dialogClass
:
''
,
close
:
function
(
e
)
{
close
:
function
(
e
vent
)
{
Drupal
.
detachBehaviors
(
e
.
target
,
null
,
'
unload
'
);
Drupal
.
detachBehaviors
(
e
vent
.
target
,
null
,
'
unload
'
);
}
}
};
};
...
@@ -24,9 +26,13 @@ Drupal.dialog = function (element, options) {
...
@@ -24,9 +26,13 @@ Drupal.dialog = function (element, options) {
// Trigger a global event to allow scripts to bind events to the dialog.
// Trigger a global event to allow scripts to bind events to the dialog.
$
(
window
).
trigger
(
'
dialog:beforecreate
'
,
[
dialog
,
$element
,
settings
]);
$
(
window
).
trigger
(
'
dialog:beforecreate
'
,
[
dialog
,
$element
,
settings
]);
$element
.
dialog
(
settings
);
$element
.
dialog
(
settings
);
if
(
settings
.
autoResize
!==
'
false
'
&&
settings
.
autoResize
!==
false
)
{
if
(
settings
.
autoResize
===
true
||
settings
.
autoResize
===
'
true
'
)
{
$
(
window
).
on
(
'
resize.dialogResize scroll.dialogResize
'
,
autoResize
);
$element
resetPosition
();
.
dialog
(
'
option
'
,
{
resizable
:
false
,
draggable
:
false
})
.
dialog
(
'
widget
'
).
css
(
'
position
'
,
'
fixed
'
);
$
(
window
)
.
on
(
'
resize.dialogResize scroll.dialogResize
'
,
settings
,
autoResize
)
.
trigger
(
'
resize.dialogResize
'
);
}
}
dialog
.
open
=
true
;
dialog
.
open
=
true
;
$
(
window
).
trigger
(
'
dialog:aftercreate
'
,
[
dialog
,
$element
,
settings
]);
$
(
window
).
trigger
(
'
dialog:aftercreate
'
,
[
dialog
,
$element
,
settings
]);
...
@@ -49,22 +55,23 @@ Drupal.dialog = function (element, options) {
...
@@ -49,22 +55,23 @@ Drupal.dialog = function (element, options) {
* be disabled by setting autoResize: false in the options array when creating
* be disabled by setting autoResize: false in the options array when creating
* a new Drupal.dialog().
* a new Drupal.dialog().
*/
*/
function
resetPosition
()
{
function
resetPosition
(
event
)
{
var
positionOptions
=
[
'
width
'
,
'
height
'
,
'
minWidth
'
,
'
minHeight
'
,
'
maxHeight
'
,
'
maxWidth
'
,
'
position
'
];
var
positionOptions
=
[
'
width
'
,
'
height
'
,
'
minWidth
'
,
'
minHeight
'
,
'
maxHeight
'
,
'
maxWidth
'
,
'
position
'
];
var
windowHeight
=
$
(
window
).
height
();
var
windowHeight
=
$
(
window
).
height
();
var
adjustedOptions
=
$
.
extend
({
position
:
{
my
:
"
center
"
,
at
:
"
center
"
,
of
:
window
}},
options
)
;
var
adjustedOptions
=
{}
;
var
optionValue
,
adjustedValue
;
var
option
,
optionValue
,
adjustedValue
;
for
(
var
n
=
0
;
n
<
positionOptions
.
length
;
n
++
)
{
for
(
var
n
=
0
;
n
<
positionOptions
.
length
;
n
++
)
{
if
(
adjustedOptions
[
positionOptions
[
n
]])
{
option
=
positionOptions
[
n
];
optionValue
=
adjustedOptions
[
positionOptions
[
n
]];
optionValue
=
event
.
data
[
option
];
if
(
optionValue
)
{
// jQuery UI does not support percentages on heights, convert to pixels.
// jQuery UI does not support percentages on heights, convert to pixels.
if
(
positionOptions
[
n
].
match
(
/height/i
)
&&
typeof
optionValue
===
'
string
'
&&
optionValue
.
match
(
/%$/
))
{
if
(
typeof
optionValue
===
'
string
'
&&
/%$/
.
test
(
optionValue
)
&&
/height/i
.
test
(
option
))
{
adjustedValue
=
parseInt
(
0.01
*
parseInt
(
optionValue
,
10
)
*
windowHeight
,
10
);
adjustedValue
=
parseInt
(
0.01
*
parseInt
(
optionValue
,
10
)
*
windowHeight
,
10
);
// Don't force the dialog to be bigger vertically than needed.
// Don't force the dialog to be bigger vertically than needed.
if
(
positionO
ption
s
[
n
]
===
'
height
'
&&
$element
.
parent
().
outerHeight
()
<
adjustedValue
)
{
if
(
o
ption
===
'
height
'
&&
$element
.
parent
().
outerHeight
()
<
adjustedValue
)
{
adjustedValue
=
'
auto
'
;
adjustedValue
=
'
auto
'
;
}
}
adjustedOptions
[
positionO
ption
s
[
n
]
]
=
adjustedValue
;
adjustedOptions
[
o
ption
]
=
adjustedValue
;
}
}
}
}
}
}
...
...
core/modules/ckeditor/js/ckeditor.js
View file @
82f8f24d
...
@@ -217,9 +217,7 @@ Drupal.ckeditor = {
...
@@ -217,9 +217,7 @@ Drupal.ckeditor = {
var
classes
=
dialogSettings
.
dialogClass
?
dialogSettings
.
dialogClass
.
split
(
'
'
)
:
[];
var
classes
=
dialogSettings
.
dialogClass
?
dialogSettings
.
dialogClass
.
split
(
'
'
)
:
[];
classes
.
push
(
'
editor-dialog
'
);
classes
.
push
(
'
editor-dialog
'
);
dialogSettings
.
dialogClass
=
classes
.
join
(
'
'
);
dialogSettings
.
dialogClass
=
classes
.
join
(
'
'
);
dialogSettings
.
maxHeight
=
'
95%
'
;
dialogSettings
.
autoResize
=
Drupal
.
checkWidthBreakpoint
(
600
);
dialogSettings
.
resizable
=
false
;
dialogSettings
.
autoResize
=
$
(
window
).
width
()
>
600
;
// Add a "Loading…" message, hide it underneath the CKEditor toolbar, create
// Add a "Loading…" message, hide it underneath the CKEditor toolbar, create
// a Drupal.ajax instance to load the dialog and trigger it.
// a Drupal.ajax instance to load the dialog and trigger it.
...
...
Write
Preview
Markdown
is supported
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