Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
neuro-images
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Александр Чаплыгин
neuro-images
Commits
7cd233eb
Commit
7cd233eb
authored
May 30, 2022
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
loading при навигации по папкам
parent
26498d88
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
2 deletions
+53
-2
styles-main.css
src/public/css/styles-main.css
+20
-0
ajax-loader.gif
src/public/img/ajax-loader.gif
+0
-0
loading.gif
src/public/img/loading.gif
+0
-0
script-main.js
src/public/js/script-main.js
+29
-2
main.phtml
src/templates/app/main.phtml
+4
-0
No files found.
src/public/css/styles-main.css
View file @
7cd233eb
...
...
@@ -25,6 +25,11 @@
{
cursor
:
pointer
;
}
.b-list_folders-item.selected
{
font-weight
:
bold
;
}
.b-preview
{
...
...
@@ -32,6 +37,21 @@
overflow
:
auto
;
}
.b-loading
{
display
:
none
;
position
:
absolute
;
top
:
0
;
left
:
0
;
height
:
100%
;
width
:
100%
;
background-image
:
url(../img/loading.gif)
;
background-position
:
center
center
;
background-repeat
:
no-repeat
;
background-color
:
#FFF
;
/*opacity: 0.5;*/
z-index
:
9999
;
}
.b-foto
{
padding
:
4px
;
}
...
...
src/public/img/ajax-loader.gif
0 → 100644
View file @
7cd233eb
3.24 KB
src/public/img/loading.gif
0 → 100644
View file @
7cd233eb
12.1 KB
src/public/js/script-main.js
View file @
7cd233eb
...
...
@@ -2,11 +2,28 @@ $(document).ready(function(){
var
$foldersContentWrap
=
$
(
'.b-preview'
),
$loading
=
$
(
'.b-loading'
),
colorsActive
=
$foldersContentWrap
.
data
(
'colors'
),
freeNumbers
=
[
1
,
2
,
3
,
4
,
5
],
currentNumToSelect
=
{},
hasSelectedFoto
=
{};
function
StartLoading
()
{
$loading
.
show
();
}
function
StopLoading
()
{
$loading
.
hide
();
}
function
MarkFolderSelected
(
$folderName
)
{
$
(
'.b-list_folders-item'
).
removeClass
(
'selected'
);
$folderName
.
addClass
(
'selected'
);
}
function
RenderFilesList
(
folderName
,
data
)
{
// Добавляем содержимое папки:
...
...
@@ -32,6 +49,7 @@ $(document).ready(function(){
$
(
'.b-list_folders-item'
).
on
(
'click'
,
function
(){
var
$this
=
$
(
this
),
$foldersContent
=
$
(
'.b-folder-content'
),
$form
=
$
(
'#load-folder-form'
),
action
=
$form
.
attr
(
'action'
),
...
...
@@ -40,24 +58,29 @@ $(document).ready(function(){
data
=
{
folder
:
folderName
};
$foldersContent
.
hide
();
if
(
$
(
'.b-folder-content[data-folder="'
+
folderName
+
'"]'
).
length
>
0
)
{
console
.
log
(
'AAA отображаем'
);
$
(
'.b-folder-content[data-folder="'
+
folderName
+
'"]'
).
show
();
MarkFolderSelected
(
$this
);
}
else
{
console
.
log
(
'AAA подгружаем'
);
StartLoading
();
$
.
ajax
(
action
,
{
type
:
method
,
data
:
data
,
success
:
function
(
data
)
{
//console.log('AAA success', data);
StopLoading
();
RenderFilesList
(
folderName
,
data
);
MarkFolderSelected
(
$this
);
},
error
:
function
(
rew
,
status
,
err
)
{
console
.
log
(
status
,
err
);
...
...
@@ -196,4 +219,7 @@ $(document).ready(function(){
});
// Отображаем содержимое первой папки при загрузке страницы:
$
(
'.b-list_folders-item'
).
first
().
click
();
});
\ No newline at end of file
src/templates/app/main.phtml
View file @
7cd233eb
...
...
@@ -65,6 +65,10 @@ $dir = $this->dir;
</div>
<div
class=
"b-preview col"
data-colors=
<?=
(
$colors_active
?
json_encode
(
$colors_active
)
:
''
)
?>
>
<div
class=
"b-loading"
></div>
</div>
...
...
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