Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
27a0938c
Commit
27a0938c
authored
Apr 06, 2016
by
d11e9
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tidy file tab handers
parent
cf7ac731
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
25 deletions
+18
-25
app.js
assets/js/app.js
+18
-25
No files found.
assets/js/app.js
View file @
27a0938c
...
...
@@ -229,7 +229,7 @@
// ----------------- file selector-------------
var
$filesEl
=
$
(
'#files'
);
$
filesEl
.
on
(
'click'
,
'.newFile'
,
function
()
{
$
(
'.newFile'
).
on
(
'click'
,
function
()
{
while
(
window
.
localStorage
[
SOL_CACHE_UNTITLED
+
untitledCount
])
untitledCount
=
(
untitledCount
-
0
)
+
1
;
SOL_CACHE_FILE
=
SOL_CACHE_UNTITLED
+
untitledCount
;
...
...
@@ -343,10 +343,10 @@
return
files
;
}
updateFiles
();
var
hidWidth
;
$filesWrapper
=
$
(
'.files-wrapper'
);
$scrollerRight
=
$
(
'.scroller-right'
);
$scrollerLeft
=
$
(
'.scroller-left'
);
function
widthOfList
(){
var
itemsWidth
=
0
;
...
...
@@ -358,55 +358,48 @@
};
function
widthOfHidden
(){
return
((
$
(
'.files-wrapper'
).
outerWidth
())
-
widthOfList
()
-
getLeftPosi
());
return
((
$
filesWrapper
.
outerWidth
())
-
widthOfList
()
-
getLeftPosi
());
};
function
widthOfVisible
(){
return
$
(
'.files-wrapper'
).
outerWidth
();
return
$
filesWrapper
.
outerWidth
();
};
function
getLeftPosi
(){
return
$
(
'#files'
).
position
().
left
;
return
$
filesEl
.
position
().
left
;
};
function
reAdjust
(){
console
.
log
(
"left start: "
,
getLeftPosi
())
console
.
log
(
"outer width: "
,
widthOfVisible
(),
"content width: "
,
widthOfList
(),
" left+vis: "
,
getLeftPosi
()
+
widthOfVisible
())
if
(
widthOfList
()
+
getLeftPosi
()
>
+
widthOfVisible
())
{
console
.
log
(
"show right scroll"
)
$
(
'.scroller-right'
).
fadeIn
(
'fast'
);
$scrollerRight
.
fadeIn
(
'fast'
);
}
else
{
console
.
log
(
"hide right scroll"
)
$
(
'.scroller-right'
).
fadeOut
(
'fast'
);
$scrollerRight
.
fadeOut
(
'fast'
);
}
if
(
getLeftPosi
()
<
0
)
{
console
.
log
(
"show left scroll"
)
$
(
'.scroller-left'
).
fadeIn
(
'fast'
);
$scrollerLeft
.
fadeIn
(
'fast'
);
}
else
{
console
.
log
(
"hide left scroll"
)
$
(
'.scroller-left'
).
fadeOut
(
'fast'
);
$
(
'#files'
).
animate
({
left
:
getLeftPosi
()
+
"px"
},
'slow'
);
$scrollerLeft
.
fadeOut
(
'fast'
);
$filesEl
.
animate
({
left
:
getLeftPosi
()
+
"px"
},
'slow'
);
}
}
$
(
'.scroller-right'
).
click
(
function
()
{
$
scrollerRight
.
click
(
function
()
{
var
delta
=
(
getLeftPosi
()
-
200
)
console
.
log
(
delta
)
$
(
'#files'
).
animate
({
left
:
delta
+
"px"
},
'slow'
,
function
(){
$filesEl
.
animate
({
left
:
delta
+
"px"
},
'slow'
,
function
(){
reAdjust
();
});
});
$
(
'.scroller-left'
).
click
(
function
()
{
$
scrollerLeft
.
click
(
function
()
{
var
delta
=
Math
.
min
(
(
getLeftPosi
()
+
200
),
0
)
console
.
log
(
delta
)
$
(
'#files'
).
animate
({
left
:
delta
+
"px"
},
'slow'
,
function
(){
$filesEl
.
animate
({
left
:
delta
+
"px"
},
'slow'
,
function
(){
reAdjust
();
});
});
updateFiles
();
// ----------------- version selector-------------
// var soljsonSources is provided by bin/list.js
...
...
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