Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Tenzing
/
pdf-customizer
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
84ba187e
authored
2016-06-28 14:55:32 -0400
by
Jeff Balicki
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
dd
1 parent
81b6cc05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
3 deletions
public/files/js/interfaceGdrive.js
public/files/js/interfaceGdrive.js
View file @
84ba187
...
...
@@ -194,6 +194,7 @@
function
changePdfOptions
(
json
)
{
jQuery
(
function
(
$
)
{
json
=
JSON
.
parse
(
json
);
...
...
@@ -204,7 +205,7 @@
var
pdflist
=
""
;
var
pdfChange
=
""
;
var
f
=
0
;
console
.
log
(
json
[
0
].
pheight
,
json
[
0
].
pwidth
);
if
(
json
[
0
].
pwidth
>
300
){
var
scaleImage
=
300
/
json
[
0
].
pwidth
;
var
imageHeight
=
json
[
0
].
pheight
*
scaleImage
;
...
...
@@ -242,16 +243,56 @@
strVar2
+=
' <div class="callout primary"><div class="row column"><h1>Welcome to Synapsus Online PDF Editor</h1>'
;
strVar2
+=
'<p class="lead">Please make your changes or return <a href="#" onclick="location.reload();">back to the list</a></p>'
;
strVar2
+=
' </div></div><div id="wrapper" class="row small-up-2 medium-up-3 large-up-3">'
;
strVar2
+=
pdflist
+
'<div id="changesColumn" class="column" >'
+
pdfChange
+
'</div><div id="pdfFooter"></div></div>'
;
strVar2
+=
pdflist
+
'<div id="changesColumn"
style="height:'
+
$
(
"#changes"
).
height
()
+
';"
class="column" >'
+
pdfChange
+
'</div><div id="pdfFooter"></div></div>'
;
document
.
getElementById
(
'contentArea'
).
innerHTML
=
strVar2
;
document
.
getElementById
(
'google_drive'
).
innerHTML
=
" "
;
jQuery
(
function
(
$
)
{
console
.
log
(
$
(
"#pdfPreview"
).
height
()
,
$
(
"#changes"
).
height
());
if
(
$
(
"#pdfPreview"
).
height
()
>
$
(
"#changes"
).
height
()){
$
(
'#changesColumn'
).
css
(
'position'
,
'relative'
);
var
stickySidebar
=
$
(
'#changesColumn'
);
if
(
stickySidebar
.
length
>
0
)
{
var
stickyHeight
=
stickySidebar
.
height
(),
sidebarTop
=
stickySidebar
.
offset
().
top
;
}
// on scroll move the sidebar
$
(
window
).
scroll
(
function
()
{
if
(
stickySidebar
.
length
>
0
)
{
var
scrollTop
=
$
(
window
).
scrollTop
();
if
(
sidebarTop
<
scrollTop
)
{
stickySidebar
.
css
(
'top'
,
scrollTop
-
sidebarTop
);
// stop the sticky sidebar at the footer to avoid overlapping
var
sidebarBottom
=
stickySidebar
.
offset
().
top
+
stickyHeight
,
stickyStop
=
$
(
'#pdfPreview'
).
offset
().
top
+
$
(
'#pdfPreview'
).
height
();
if
(
stickyStop
<
sidebarBottom
)
{
var
stopPosition
=
$
(
'#pdfPreview'
).
height
()
-
stickyHeight
;
stickySidebar
.
css
(
'top'
,
stopPosition
);
}
}
else
{
stickySidebar
.
css
(
'top'
,
'0'
);
}
}
});
$
(
window
).
resize
(
function
()
{
if
(
stickySidebar
.
length
>
0
)
{
stickyHeight
=
stickySidebar
.
height
();
}
});
}
else
{
console
.
log
(
'false'
);
var
stickySidebar
=
$
(
'#pdfPreview'
);
if
(
stickySidebar
.
length
>
0
)
{
...
...
@@ -286,6 +327,11 @@ $(window).resize(function () {
stickyHeight
=
stickySidebar
.
height
();
}
});
}
...
...
Please
register
or
sign in
to post a comment