remove logs

pull/1/head
d11e9 9 years ago
parent a8a879fa40
commit 1d1ddcf8b0
  1. 154
      assets/js/app.js

@ -123,7 +123,7 @@
var files = getFiles();
for (var x in files)
for (var x in files) {
sessions[files[x]] = newEditorSession(files[x])
editor.setSession( sessions[SOL_CACHE_FILE] );
@ -226,24 +226,24 @@
});
// ----------------- file selector-------------
var $filesEl = $('#files');
var FILE_SCROLL_DELTA = 300;
$('.newFile').on('click', function() {
while (window.localStorage[SOL_CACHE_UNTITLED + untitledCount])
untitledCount = (untitledCount - 0) + 1;
SOL_CACHE_FILE = SOL_CACHE_UNTITLED + untitledCount;
window.localStorage[SOL_CACHE_FILE] = '';
updateFiles();
$filesEl.animate({left: (0 - activeFilePos() + (FILE_SCROLL_DELTA/2)) + "px"}, "slow", function(){
reAdjust();
})
});
$filesEl.on('click', '.file:not(.active)', showFileHandler);
// ----------------- file selector-------------
var $filesEl = $('#files');
var FILE_SCROLL_DELTA = 300;
$('.newFile').on('click', function() {
while (window.localStorage[SOL_CACHE_UNTITLED + untitledCount])
untitledCount = (untitledCount - 0) + 1;
SOL_CACHE_FILE = SOL_CACHE_UNTITLED + untitledCount;
window.localStorage[SOL_CACHE_FILE] = '';
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.active', function(ev) {
var $fileTabEl = $(this);
@ -350,9 +350,9 @@
}
$filesWrapper = $('.files-wrapper');
$scrollerRight = $('.scroller-right');
$scrollerLeft = $('.scroller-left');
$filesWrapper = $('.files-wrapper');
$scrollerRight = $('.scroller-right');
$scrollerLeft = $('.scroller-left');
function widthOfList (){
var itemsWidth = 0;
@ -361,61 +361,61 @@
itemsWidth += itemWidth;
});
return itemsWidth;
};
function widthOfHidden(){
return (($filesWrapper.outerWidth()) - widthOfList() - getLeftPosi());
};
function widthOfVisible(){
return $filesWrapper.outerWidth();
};
function getLeftPosi(){
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 (){
if (widthOfList() + getLeftPosi() > + widthOfVisible()) {
$scrollerRight.fadeIn('fast');
} else {
$scrollerRight.fadeOut('fast');
}
if (getLeftPosi()<0) {
$scrollerLeft.fadeIn('fast');
} else {
$scrollerLeft.fadeOut('fast');
$filesEl.animate({left: getLeftPosi() + "px"},'slow');
}
}
$scrollerRight.click(function() {
var delta = (getLeftPosi() - FILE_SCROLL_DELTA)
$filesEl.animate({left: delta + "px"},'slow',function(){
reAdjust();
});
});
$scrollerLeft.click(function() {
var delta = Math.min( (getLeftPosi() + FILE_SCROLL_DELTA), 0 )
$filesEl.animate({left: delta + "px"},'slow',function(){
reAdjust();
});
});
updateFiles();
// ----------------- version selector-------------
// var soljsonSources is provided by bin/list.js
};
function widthOfHidden(){
return (($filesWrapper.outerWidth()) - widthOfList() - getLeftPosi());
};
function widthOfVisible(){
return $filesWrapper.outerWidth();
};
function getLeftPosi(){
return $filesEl.position().left;
};
function activeFilePos() {
var el = $filesEl.find('.active');
var l = el.position().left;
return l;
}
function reAdjust (){
if (widthOfList() + getLeftPosi() > + widthOfVisible()) {
$scrollerRight.fadeIn('fast');
} else {
$scrollerRight.fadeOut('fast');
}
if (getLeftPosi()<0) {
$scrollerLeft.fadeIn('fast');
} else {
$scrollerLeft.fadeOut('fast');
$filesEl.animate({left: getLeftPosi() + "px"},'slow');
}
}
$scrollerRight.click(function() {
var delta = (getLeftPosi() - FILE_SCROLL_DELTA)
$filesEl.animate({left: delta + "px"},'slow',function(){
reAdjust();
});
});
$scrollerLeft.click(function() {
var delta = Math.min( (getLeftPosi() + FILE_SCROLL_DELTA), 0 )
$filesEl.animate({left: delta + "px"},'slow',function(){
reAdjust();
});
});
updateFiles();
// ----------------- version selector-------------
// var soljsonSources is provided by bin/list.js
$('option', '#versionSelector').remove();
$.each(soljsonSources, function(i, file) {
if (file) {

Loading…
Cancel
Save