|
|
@ -229,12 +229,18 @@ |
|
|
|
// ----------------- file selector-------------
|
|
|
|
// ----------------- file selector-------------
|
|
|
|
|
|
|
|
|
|
|
|
var $filesEl = $('#files'); |
|
|
|
var $filesEl = $('#files'); |
|
|
|
|
|
|
|
var FILE_SCROLL_DELTA = 300; |
|
|
|
|
|
|
|
|
|
|
|
$('.newFile').on('click', function() { |
|
|
|
$('.newFile').on('click', function() { |
|
|
|
while (window.localStorage[SOL_CACHE_UNTITLED + untitledCount]) |
|
|
|
while (window.localStorage[SOL_CACHE_UNTITLED + untitledCount]) |
|
|
|
untitledCount = (untitledCount - 0) + 1; |
|
|
|
untitledCount = (untitledCount - 0) + 1; |
|
|
|
SOL_CACHE_FILE = SOL_CACHE_UNTITLED + untitledCount; |
|
|
|
SOL_CACHE_FILE = SOL_CACHE_UNTITLED + untitledCount; |
|
|
|
window.localStorage[SOL_CACHE_FILE] = ''; |
|
|
|
window.localStorage[SOL_CACHE_FILE] = ''; |
|
|
|
updateFiles(); |
|
|
|
updateFiles(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$filesEl.animate({left: (0 - activeFilePos() + (FILE_SCROLL_DELTA/2)) + "px"}, "slow", function(){ |
|
|
|
|
|
|
|
reAdjust(); |
|
|
|
|
|
|
|
}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$filesEl.on('click', '.file:not(.active)', showFileHandler); |
|
|
|
$filesEl.on('click', '.file:not(.active)', showFileHandler); |
|
|
@ -369,6 +375,13 @@ |
|
|
|
return $filesEl.position().left; |
|
|
|
return $filesEl.position().left; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function activeFilePos() { |
|
|
|
|
|
|
|
var el = $filesEl.find('.active'); |
|
|
|
|
|
|
|
var l = el.position().left; |
|
|
|
|
|
|
|
console.log("active file left", l, el) |
|
|
|
|
|
|
|
return l; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function reAdjust (){ |
|
|
|
function reAdjust (){ |
|
|
|
if (widthOfList() + getLeftPosi() > + widthOfVisible()) { |
|
|
|
if (widthOfList() + getLeftPosi() > + widthOfVisible()) { |
|
|
|
$scrollerRight.fadeIn('fast'); |
|
|
|
$scrollerRight.fadeIn('fast'); |
|
|
@ -385,14 +398,14 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$scrollerRight.click(function() { |
|
|
|
$scrollerRight.click(function() { |
|
|
|
var delta = (getLeftPosi() - 200) |
|
|
|
var delta = (getLeftPosi() - FILE_SCROLL_DELTA) |
|
|
|
$filesEl.animate({left: delta + "px"},'slow',function(){ |
|
|
|
$filesEl.animate({left: delta + "px"},'slow',function(){ |
|
|
|
reAdjust(); |
|
|
|
reAdjust(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$scrollerLeft.click(function() { |
|
|
|
$scrollerLeft.click(function() { |
|
|
|
var delta = Math.min( (getLeftPosi() + 200), 0 ) |
|
|
|
var delta = Math.min( (getLeftPosi() + FILE_SCROLL_DELTA), 0 ) |
|
|
|
$filesEl.animate({left: delta + "px"},'slow',function(){ |
|
|
|
$filesEl.animate({left: delta + "px"},'slow',function(){ |
|
|
|
reAdjust(); |
|
|
|
reAdjust(); |
|
|
|
}); |
|
|
|
}); |
|
|
|