Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
229
Merge Requests
229
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
5d4fa6f7
Commit
5d4fa6f7
authored
May 23, 2010
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Rollback of
#787940
.
parent
8ce16745
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
89 additions
and
40 deletions
+89
-40
misc/drupal.js
misc/drupal.js
+0
-18
misc/tableheader.js
misc/tableheader.js
+1
-1
modules/overlay/overlay-parent.js
modules/overlay/overlay-parent.js
+12
-6
modules/overlay/overlay.module
modules/overlay/overlay.module
+10
-0
modules/system/system.css
modules/system/system.css
+20
-0
modules/toolbar/toolbar.css
modules/toolbar/toolbar.css
+25
-10
modules/toolbar/toolbar.js
modules/toolbar/toolbar.js
+15
-2
modules/toolbar/toolbar.module
modules/toolbar/toolbar.module
+5
-2
modules/toolbar/toolbar.tpl.php
modules/toolbar/toolbar.tpl.php
+1
-1
No files found.
misc/drupal.js
View file @
5d4fa6f7
...
...
@@ -299,24 +299,6 @@ Drupal.getSelection = function (element) {
return
{
'
start
'
:
element
.
selectionStart
,
'
end
'
:
element
.
selectionEnd
};
};
/**
* Checks if position:fixed is supported.
*
* @return
* Boolean indicating whether or not position:fixed is supported.
*
* @see http://yura.thinkweb2.com/cft/#IS_POSITION_FIXED_SUPPORTED
*/
Drupal
.
positionFixedSupported
=
function
()
{
if
(
this
.
_positionFixedSupported
===
undefined
)
{
var
el
=
$
(
'
<div style="position:fixed; top:10px" />
'
).
appendTo
(
document
.
body
);
this
.
_positionFixedSupported
=
el
[
0
].
offsetTop
===
10
;
el
.
remove
();
}
return
this
.
_positionFixedSupported
;
};
/**
* Build an error message from an AJAX response.
*/
...
...
misc/tableheader.js
View file @
5d4fa6f7
...
...
@@ -42,7 +42,7 @@ Drupal.behaviors.tableHeader = {
// Track positioning and visibility.
function
tracker
(
e
)
{
// Reset top position of sticky table headers to the current top offset.
var
topOffset
=
Drupal
.
displace
?
Drupal
.
displace
.
getDisplacement
(
'
top
'
)
:
0
;
var
topOffset
=
Drupal
.
settings
.
tableHeaderOffset
?
eval
(
Drupal
.
settings
.
tableHeaderOffset
+
'
()
'
)
:
0
;
$
(
'
.sticky-header
'
).
css
(
'
top
'
,
topOffset
+
'
px
'
);
// Save positioning data.
var
viewHeight
=
document
.
documentElement
.
scrollHeight
||
document
.
body
.
scrollHeight
;
...
...
modules/overlay/overlay-parent.js
View file @
5d4fa6f7
...
...
@@ -650,9 +650,15 @@ Drupal.overlay.outerResize = function () {
return
;
}
var
displaceTop
=
Drupal
.
displace
?
Drupal
.
displace
.
getDisplacement
(
'
top
'
)
:
0
;
// Consider any region that should be visible above the overlay (such as
// an admin toolbar).
var
$displaceTop
=
$
(
'
.overlay-displace-top
'
);
var
displaceTopHeight
=
0
;
$displaceTop
.
each
(
function
()
{
displaceTopHeight
+=
$
(
this
).
height
();
});
self
.
$wrapper
.
css
(
'
top
'
,
displaceTop
);
self
.
$wrapper
.
css
(
'
top
'
,
displaceTop
Height
);
// When the overlay has no height yet, make it fit exactly in the window,
// or the configured height when autoFit is disabled.
...
...
@@ -660,7 +666,7 @@ Drupal.overlay.outerResize = function () {
var
titleBarHeight
=
self
.
$dialogTitlebar
.
outerHeight
(
true
);
if
(
self
.
options
.
autoFit
||
self
.
options
.
height
==
undefined
||!
isNan
(
self
.
options
.
height
))
{
self
.
lastHeight
=
parseInt
(
$
(
window
).
height
()
-
displaceTop
-
titleBarHeight
-
45
);
self
.
lastHeight
=
parseInt
(
$
(
window
).
height
()
-
displaceTop
Height
-
titleBarHeight
-
45
);
}
else
{
self
.
lastHeight
=
self
.
options
.
height
;
...
...
@@ -697,11 +703,11 @@ Drupal.overlay.clickHandler = function (event) {
var
$target
=
$
(
event
.
target
);
if
(
self
.
isOpen
&&
$target
.
closest
(
'
.
displace-top, .
displace-bottom
'
).
length
)
{
if
(
self
.
isOpen
&&
$target
.
closest
(
'
.
overlay-displace-top, .overlay-
displace-bottom
'
).
length
)
{
// Click events in displaced regions could potentionally change the size of
// that region (e.g. the toggle button of the toolbar module). Trigger the
// resize event to force a recalculation of overlay's size/position.
$
(
window
).
triggerHandler
(
'
resize
'
);
$
(
window
).
triggerHandler
(
'
resize
.overlay-event
'
);
}
// Only continue by left-click or right-click.
...
...
@@ -923,7 +929,7 @@ Drupal.overlay.resetActiveClass = function(activePath) {
var
self
=
this
;
var
windowDomain
=
window
.
location
.
protocol
+
window
.
location
.
hostname
;
$
(
'
.
displace-top, .
displace-bottom
'
)
$
(
'
.
overlay-displace-top, .overlay-
displace-bottom
'
)
.
find
(
'
a[href]
'
)
// Remove active class from all links in displaced regions.
.
removeClass
(
'
active
'
)
...
...
modules/overlay/overlay.module
View file @
5d4fa6f7
...
...
@@ -299,6 +299,16 @@ function overlay_preprocess_page(&$variables) {
}
}
/**
* Preprocess template variables for toolbar.tpl.php.
*
* Adding the 'overlay-displace-top' class to the toolbar pushes the overlay
* down, so it appears below the toolbar.
*/
function
overlay_preprocess_toolbar
(
&
$variables
)
{
$variables
[
'classes_array'
][]
=
"overlay-displace-top"
;
}
/**
* Form after_build callback.
*
...
...
modules/system/system.css
View file @
5d4fa6f7
...
...
@@ -274,6 +274,26 @@ tr.selected td {
position
:
absolute
;
}
/*
** To be used with displace.js
*/
.displace-top
,
.displace-bottom
{
position
:
relative
;
width
:
100%
;
}
.displace-processed
.displace-top
,
.displace-processed
.displace-bottom
{
position
:
fixed
;
width
:
auto
;
left
:
0
;
right
:
0
;
}
.displace-unsupported
.displace-top
,
.displace-unsupported
.displace-bottom
{
position
:
absolute
;
}
/*
** Floating header for tableheader.js
*/
...
...
modules/toolbar/toolbar.css
View file @
5d4fa6f7
/* $Id$ */
body
.toolbar
{
padding-top
:
2.2em
;
}
body
.toolbar-drawer
{
padding-top
:
5.3em
;
}
/**
* Aggressive resets so we can achieve a consistent look in hostile CSS
...
...
@@ -26,8 +32,10 @@
font
:
normal
0.9em
"Lucida Grande"
,
Verdana
,
sans-serif
;
background
:
#666
;
color
:
#ccc
;
}
.displace-processed
#toolbar
{
position
:
fixed
;
top
:
0
;
left
:
0
;
right
:
0
;
margin
:
0
-20px
;
padding
:
0
20px
;
z-index
:
600
;
...
...
@@ -37,14 +45,6 @@
filter
:
progid
:
DXImageTransform
.
Microsoft
.
Shadow
(
color
=
#000000
,
direction
=
'180'
,
strength
=
'10'
);
-ms-filter
:
"progid:DXImageTransform.Microsoft.Shadow(color=#000000, direction='180', strength='10')"
;
}
.displace-unsupported
#toolbar
{
margin
:
0
;
padding-right
:
0
;
left
:
-20px
;
right
:
0
;
width
:
100%
;
}
#toolbar
div
.collapsed
{
display
:
none
;
...
...
@@ -132,3 +132,18 @@
position
:
relative
;
padding
:
0
10px
;
}
/**
* IE 6 Fix.
*
* IE 6 shows elements with position:fixed as position:static so we replace
* it with position:absolute; toolbar needs it's z-index to stay above overlay.
*/
*
html
#toolbar
{
position
:
absolute
;
margin
:
0
;
padding-right
:
0
;
left
:
-20px
;
right
:
0
;
width
:
100%
;
}
modules/toolbar/toolbar.js
View file @
5d4fa6f7
...
...
@@ -15,8 +15,9 @@ Drupal.behaviors.toolbar = {
// Toggling toolbar drawer.
$
(
'
#toolbar a.toggle
'
,
context
).
once
(
'
toolbar-toggle
'
).
click
(
function
(
e
)
{
Drupal
.
toolbar
.
toggle
();
// Allow resize event handlers to recalculate sizes/positions.
$
(
window
).
triggerHandler
(
'
resize
'
);
// As the toolbar is an overlay displaced region, overlay should be
// notified of it's height change to adapt its position.
$
(
window
).
triggerHandler
(
'
resize.overlay-event
'
);
return
false
;
});
}
...
...
@@ -48,6 +49,7 @@ Drupal.toolbar.collapse = function() {
.
removeClass
(
'
toggle-active
'
)
.
attr
(
'
title
'
,
toggle_text
)
.
html
(
toggle_text
);
$
(
'
body
'
).
removeClass
(
'
toolbar-drawer
'
).
css
(
'
paddingTop
'
,
Drupal
.
toolbar
.
height
());
$
.
cookie
(
'
Drupal.toolbar.collapsed
'
,
1
,
...
...
@@ -69,6 +71,7 @@ Drupal.toolbar.expand = function() {
.
addClass
(
'
toggle-active
'
)
.
attr
(
'
title
'
,
toggle_text
)
.
html
(
toggle_text
);
$
(
'
body
'
).
addClass
(
'
toolbar-drawer
'
).
css
(
'
paddingTop
'
,
Drupal
.
toolbar
.
height
());
$
.
cookie
(
'
Drupal.toolbar.collapsed
'
,
0
,
...
...
@@ -92,4 +95,14 @@ Drupal.toolbar.toggle = function() {
}
};
Drupal
.
toolbar
.
height
=
function
()
{
var
height
=
$
(
'
#toolbar
'
).
outerHeight
();
// In IE, Shadow filter adds some extra height, so we need to remove it from
// the returned height.
if
(
$
(
'
#toolbar
'
).
css
(
'
filter
'
).
match
(
/DXImageTransform
\.
Microsoft
\.
Shadow/
))
{
height
-=
$
(
'
#toolbar
'
).
get
(
0
).
filters
.
item
(
"
DXImageTransform.Microsoft.Shadow
"
).
strength
;
}
return
height
;
};
})(
jQuery
);
modules/toolbar/toolbar.module
View file @
5d4fa6f7
...
...
@@ -177,9 +177,12 @@ function toolbar_view() {
'#theme'
=>
'toolbar'
,
'#attached'
=>
array
(
'js'
=>
array
(
array
(
'data'
=>
'misc/displace.js'
,
'weight'
=>
JS_LIBRARY
-
1
),
array
(
'data'
=>
'misc/jquery.cookie.js'
,
'weight'
=>
JS_LIBRARY
+
2
),
$module_path
.
'/toolbar.js'
,
array
(
'data'
=>
'misc/jquery.cookie.js'
,
'weight'
=>
JS_LIBRARY
+
2
),
array
(
'data'
=>
array
(
'tableHeaderOffset'
=>
'Drupal.toolbar.height'
),
'type'
=>
'setting'
),
),
'css'
=>
array
(
$module_path
.
'/toolbar.css'
,
...
...
modules/toolbar/toolbar.tpl.php
View file @
5d4fa6f7
...
...
@@ -22,7 +22,7 @@
* @see template_preprocess_toolbar()
*/
?>
<div
id=
"toolbar"
class=
"
<?php
print
$classes
;
?>
displace-top
clearfix"
>
<div
id=
"toolbar"
class=
"
<?php
print
$classes
;
?>
clearfix"
>
<div
class=
"toolbar-menu clearfix"
>
<?php
print
render
(
$toolbar
[
'toolbar_home'
]);
?>
<?php
print
render
(
$toolbar
[
'toolbar_user'
]);
?>
...
...
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