started work on panel auto-hide -- still not done...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-12-23 05:16:14 +04:00
parent cbe7d3f4b8
commit a38727b6eb
2 changed files with 14 additions and 2 deletions

View File

@ -77,6 +77,7 @@
min-width: 10px; min-width: 10px;
background: white; background: white;
opacity: 0.95;
box-shadow: 5px 5px 30px -5px rgba(0, 0, 0, 0.3); box-shadow: 5px 5px 30px -5px rgba(0, 0, 0, 0.3);
} }
@ -89,6 +90,15 @@
border-left: solid 1px silver; border-left: solid 1px silver;
} }
.side-panel.auto-hide {
width: 10px;
overflow: hidden;
}
.side-panel.auto-hide:hover {
width: auto;
overflow: visible;
}
/* main controls */ /* main controls */
.sub-panel .control { .sub-panel .control {

View File

@ -16,7 +16,7 @@
function _setupPanel(panel){ function _setupPanel(panel){
return panel return panel
.on('panelClosing', function(){ .on('panelClosing', function(){
if($('.panel').length <= 1){ if($('.sub-panel').length <= 1){
// XXX when not only the editor is using the panels, this // XXX when not only the editor is using the panels, this
// is not the correct way to go... // is not the correct way to go...
toggleEditor('off') toggleEditor('off')
@ -40,12 +40,14 @@ var toggleEditor = createCSSClassToggler(
function(action){ function(action){
// XXX when not only the editor is using the panels, this // XXX when not only the editor is using the panels, this
// is not the correct way to go... // is not the correct way to go...
var ed = $('.panel') var ed = $('.panel, .side-panel')
if(action == 'on'){ if(action == 'on'){
// create the editor if this is first init... // create the editor if this is first init...
if(ed.length == 0){ if(ed.length == 0){
$('.viewer') $('.viewer')
.append(makeSidePanel('left'))
.append(makeSidePanel('right'))
.append(_setupPanel(makeEditorControls('.current.image')) .append(_setupPanel(makeEditorControls('.current.image'))
//.draggable('option', 'snap', '.viewer') //.draggable('option', 'snap', '.viewer')
.css({ .css({