Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Belgian Biodiversity Platform
yeti
Commits
90700bc7
Commit
90700bc7
authored
Apr 12, 2012
by
Julien Cigar
Browse files
set_title, set_body, set_position, ...
parent
ad730d5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
ui.js
View file @
90700bc7
...
@@ -23,13 +23,14 @@
...
@@ -23,13 +23,14 @@
if
(
this
.
options
.
onscroll
==
'
scroll
'
)
{
if
(
this
.
options
.
onscroll
==
'
scroll
'
)
{
Yeti
.
Evt
.
bind
(
window
,
'
scroll
'
,
function
()
{
Yeti
.
Evt
.
bind
(
window
,
'
scroll
'
,
function
()
{
_self
.
refresh
_position
();
_self
.
set
_position
();
});
});
}
}
this
.
container
=
document
.
body
;
this
.
container
=
document
.
body
;
this
.
frame
=
document
.
createElement
(
'
div
'
);
this
.
frame
=
document
.
createElement
(
'
div
'
);
this
.
header
=
document
.
createElement
(
'
div
'
);
this
.
header
=
document
.
createElement
(
'
div
'
);
this
.
title
=
document
.
createElement
(
'
span
'
);
this
.
body
=
document
.
createElement
(
'
div
'
);
this
.
body
=
document
.
createElement
(
'
div
'
);
this
.
frame
.
style
.
zIndex
=
this
.
options
.
zindex
;
this
.
frame
.
style
.
zIndex
=
this
.
options
.
zindex
;
...
@@ -55,17 +56,19 @@
...
@@ -55,17 +56,19 @@
Yeti
.
DOM
.
addClass
(
this
.
frame
,
'
ui-frame
'
);
Yeti
.
DOM
.
addClass
(
this
.
frame
,
'
ui-frame
'
);
Yeti
.
DOM
.
addClass
(
this
.
header
,
'
ui-frame-header
'
);
Yeti
.
DOM
.
addClass
(
this
.
header
,
'
ui-frame-header
'
);
Yeti
.
DOM
.
addClass
(
this
.
title
,
'
ui-frame-title
'
);
Yeti
.
DOM
.
addClass
(
this
.
body
,
'
ui-frame-body
'
);
Yeti
.
DOM
.
addClass
(
this
.
body
,
'
ui-frame-body
'
);
this
.
header
.
appendChild
(
document
.
createTextNode
(
this
.
options
.
title
));
this
.
header
.
appendChild
(
this
.
title
);
this
.
frame
.
appendChild
(
this
.
header
);
this
.
frame
.
appendChild
(
this
.
header
);
this
.
frame
.
appendChild
(
this
.
body
);
this
.
frame
.
appendChild
(
this
.
body
);
this
.
frame
.
style
.
width
=
this
.
options
.
width
;
this
.
frame
.
style
.
width
=
this
.
options
.
width
;
this
.
frame
.
style
.
height
=
this
.
options
.
height
;
this
.
frame
.
style
.
height
=
this
.
options
.
height
;
this
.
refresh_position
();
this
.
set_title
(
this
.
options
.
title
);
this
.
set_body
(
this
.
options
.
body
);
this
.
set_position
();
}
}
UI
.
Frame
.
prototype
.
update_options
=
function
(
opts
)
{
UI
.
Frame
.
prototype
.
update_options
=
function
(
opts
)
{
...
@@ -97,13 +100,29 @@
...
@@ -97,13 +100,29 @@
}
}
}
}
UI
.
Frame
.
prototype
.
refresh
_position
=
function
()
{
UI
.
Frame
.
prototype
.
set
_position
=
function
(
position
)
{
var
position
=
this
.
get_position
();
var
position
=
position
||
this
.
get_position
();
this
.
frame
.
style
.
left
=
position
.
left
;
this
.
frame
.
style
.
left
=
position
.
left
;
this
.
frame
.
style
.
top
=
position
.
top
;
this
.
frame
.
style
.
top
=
position
.
top
;
}
}
UI
.
Frame
.
prototype
.
set_title
=
function
(
value
)
{
Yeti
.
DOM
.
removeNodes
(
this
.
title
);
this
.
title
.
appendChild
(
document
.
createTextNode
(
value
));
}
UI
.
Frame
.
prototype
.
set_body
=
function
(
value
)
{
var
content
=
Yeti
.
Element
(
value
);
if
(
content
)
{
Yeti
.
DOM
.
removeNodes
(
this
.
body
);
if
(
content
.
style
.
display
==
'
none
'
)
{
content
.
style
.
display
=
'
block
'
;
}
this
.
body
.
appendChild
(
content
);
}
}
UI
.
Frame
.
prototype
.
attach
=
function
()
{
UI
.
Frame
.
prototype
.
attach
=
function
()
{
if
(
this
.
overlay
)
{
if
(
this
.
overlay
)
{
this
.
container
.
appendChild
(
this
.
overlay
);
this
.
container
.
appendChild
(
this
.
overlay
);
...
...
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