forked from 0x2620/oxjs
some support for resizing
This commit is contained in:
parent
37ecdd99ac
commit
d915e9f205
3 changed files with 61 additions and 24 deletions
|
|
@ -11,7 +11,7 @@ Ox.load('UI', {debug: true, hideScreen: true, showScreen: true, theme: 'modern'}
|
|||
|
||||
//Ox.print('$$$$', Ox.Calendar)
|
||||
|
||||
Ox.Calendar({
|
||||
var $calendar = Ox.Calendar({
|
||||
date: new Date(0),
|
||||
events: [
|
||||
|
||||
|
|
@ -623,8 +623,41 @@ Ox.load('UI', {debug: true, hideScreen: true, showScreen: true, theme: 'modern'}
|
|||
],
|
||||
height: window.innerHeight,
|
||||
range: [-5000, 5000],
|
||||
width: window.innerWidth,
|
||||
width: window.innerWidth - 257,
|
||||
zoom: 2
|
||||
}).appendTo(Ox.UI.$body).gainFocus();
|
||||
});
|
||||
|
||||
var $panel = Ox.SplitPanel({
|
||||
elements: [
|
||||
{
|
||||
element: $calendar
|
||||
},
|
||||
{
|
||||
collapsible: true,
|
||||
element: Ox.Element(),
|
||||
resizable: true,
|
||||
resize: [128, 256, 384],
|
||||
size: 256
|
||||
}
|
||||
],
|
||||
orientation: 'horizontal'
|
||||
}).appendTo(Ox.UI.$body);
|
||||
|
||||
$calendar
|
||||
.bindEvent({
|
||||
resize: function(foo, size) {
|
||||
$calendar.options({width: window.innerWidth - $panel.getSize(1)});
|
||||
}
|
||||
})
|
||||
.gainFocus();
|
||||
|
||||
Ox.UI.$window.bind({
|
||||
resize: function(e) {
|
||||
$calendar.options({
|
||||
height: window.innerHeight,
|
||||
width: window.innerWidth - $panel.getSize(1)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue