Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
f4750a42
Commit
f4750a42
authored
Apr 29, 2016
by
Евгений Мичкарев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Реализована автоподгрузка постов
parent
6198fc1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
37 deletions
+53
-37
frontend/views/layouts/block/callback.php
frontend/views/layouts/block/callback.php
+3
-2
frontend/web/js/custom.js
frontend/web/js/custom.js
+50
-35
No files found.
frontend/views/layouts/block/callback.php
View file @
f4750a42
...
...
@@ -58,6 +58,7 @@ use common\modules\bids\models\Bid;
<?php
ActiveForm
::
end
();
?>
</div>
<?php
echo
\common\modules\users\widgets\LoginWidget
::
widget
();
?>
<?php
echo
\common\modules\users\widgets\RegistrationWidget
::
widget
();
?>
<?php
//todo ?? ?>
<?
php
//echo \common\modules\users\widgets\LoginWidget::widget(); ?>
<?
php
//echo \common\modules\users\widgets\RegistrationWidget::widget(); ?>
</
div
>
\ No newline at end of file
frontend/web/js/custom.js
View file @
f4750a42
...
...
@@ -68,41 +68,7 @@ $(document).ready(function() {
return
false
;
});
$
(
'
a#load-post
'
).
click
(
function
()
{
var
button
=
$
(
this
),
loading
=
$
(
'
.loading-post
'
),
offset
=
button
.
data
(
'
offset
'
),
tag
=
button
.
data
(
'
tag
'
);
button
.
hide
();
loading
.
show
();
$
.
ajax
({
method
:
'
POST
'
,
url
:
$
(
this
).
attr
(
'
href
'
),
data
:
{
offset
:
offset
,
tag
:
tag
},
success
:
function
(
response
)
{
$
(
'
.loaded
'
).
append
(
response
.
posts
);
button
.
data
(
'
offset
'
,
response
.
offset
);
if
(
response
.
count
<=
response
.
offset
)
{
button
.
hide
();
}
else
{
button
.
show
();
}
loading
.
hide
();
}
});
return
false
;
});
$
(
'
a#load-post
'
).
click
(
loadPosts
);
$
.
ajax
({
url
:
"
/sessions/default/add
"
...
...
@@ -133,8 +99,57 @@ $(document).ready(function() {
}).
on
(
'
submit
'
,
function
(
e
){
return
false
;
});
var
maxPosition
=
$
(
window
).
scrollTop
();
$
(
window
).
scroll
(
function
()
{
var
position
=
$
(
window
).
scrollTop
()
+
$
(
window
).
height
();
if
(
position
>=
maxPosition
&&
position
>=
$
(
document
).
height
()
-
800
&&
!
loadProcess
&&
!
allPostsLoaded
)
{
maxPosition
=
position
;
loadPosts
();
}
});
});
var
loadProcess
=
false
;
var
allPostsLoaded
=
false
;
function
loadPosts
()
{
var
button
=
$
(
'
a#load-post
'
),
loading
=
$
(
'
.loading-post
'
),
offset
=
button
.
data
(
'
offset
'
),
tag
=
button
.
data
(
'
tag
'
);
$
.
ajax
({
method
:
'
POST
'
,
url
:
button
.
attr
(
'
href
'
),
data
:
{
offset
:
offset
,
tag
:
tag
},
success
:
function
(
response
)
{
$
(
'
.loaded
'
).
append
(
response
.
posts
);
button
.
data
(
'
offset
'
,
response
.
offset
);
if
(
response
.
count
<=
response
.
offset
)
{
allPostsLoaded
=
true
;
button
.
hide
();
}
else
{
button
.
show
();
}
},
beforeSend
:
function
()
{
button
.
hide
();
loading
.
show
();
loadProcess
=
true
;
}
}).
done
(
function
()
{
loading
.
hide
();
loadProcess
=
false
;
});
return
false
;
}
if
(
$
(
'
#chart-container
'
).
length
>
0
)
{
FusionCharts
.
ready
(
function
()
{
...
...
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