Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
kus-admin
Commits
2c622f30
Commit
2c622f30
authored
Feb 03, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slider heighter
parent
b69c2994
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
17 deletions
+27
-17
MainController.jsx
src/controller/MainController.jsx
+0
-15
Store.jsx
src/model/Store.jsx
+17
-0
CardSlider.jsx
src/view/cmp/cardSlider/CardSlider.jsx
+8
-1
PaginationSlider.jsx
src/view/cmp/paginationSlider/PaginationSlider.jsx
+2
-0
Account.jsx
src/view/page/account/Account.jsx
+0
-1
No files found.
src/controller/MainController.jsx
View file @
2c622f30
import
{
AsyncAuthAjax
}
from
"./Ajax"
;
import
{
API
}
from
"../dict/Consts"
;
Model
.
cards
.
getArray
=
function
()
{
const
out
=
[];
let
categoryItems
;
for
(
let
categoryID
in
this
.
_props
){
if
(
categoryID
!==
'_VERSION_'
){
categoryItems
=
this
.
_props
[
categoryID
]
for
(
let
id
in
categoryItems
){
out
.
push
(
categoryItems
[
id
]);
}
}
}
return
out
;
};
store
.
sub
(
'navigation.current'
,
(
val
)
=>
tmpStore
.
set
(
'navigation.current'
,
val
));
store
.
sub
([
'navigation.current'
,
'loaded.cards'
],
async
function
(
page
,
loaded
)
{
...
...
src/model/Store.jsx
View file @
2c622f30
...
...
@@ -126,6 +126,23 @@ const Model = {
history
:
history
};
Model
.
cards
.
getArray
=
function
()
{
const
out
=
[];
let
categoryItems
;
for
(
let
categoryID
in
this
.
_props
){
if
(
!
this
.
_props
.
hasOwnProperty
(
categoryID
))
continue
;
if
(
categoryID
!==
'_VERSION_'
){
categoryItems
=
this
.
_props
[
categoryID
];
for
(
let
id
in
categoryItems
){
out
.
push
(
categoryItems
[
id
]);
}
}
}
return
out
;
};
categories
.
loading
=
{};
const
AsyncResourceLoaderQueue
=
function
(
cfg
)
{
...
...
src/view/cmp/cardSlider/CardSlider.jsx
View file @
2c622f30
...
...
@@ -109,6 +109,10 @@ const CardSlider = (function(){
let
firstItem
=
Math
.
round
(
fromLeft
/
(
this
.
preset
.
cardWidth
+
this
.
world
.
padding
));
this
.
leftButtonDisabled
.
set
(
firstItem
===
0
);
this
.
rightButtonDisabled
.
set
(
firstItem
+
this
.
world
.
fullCardsCount
>=
this
.
items
.
length
);
if
(
this
.
cfg
.
setOuterHeight
){
this
.
scroller
.
style
.
height
=
(
this
.
hash
[
firstItem
].
dom
.
clientHeight
+
40
)
+
'px'
;
}
//console.log(this.leftButtonDisabled.get(), this.rightButtonDisabled.get())
},
untune
:
function
()
{
...
...
@@ -200,6 +204,7 @@ const CardSlider = (function(){
let
{
lastFrom
,
lastTo
,
last
}
=
this
;
let
{
cardWidth
}
=
this
.
preset
;
let
{
padding
}
=
this
.
world
;
let
{
setOuterHeight
}
=
this
.
cfg
;
let
from
=
Math
.
floor
(
scroller
.
scrollLeft
/
(
cardWidth
+
padding
)
-
1
),
count
=
Math
.
ceil
(
scroller
.
clientWidth
/
(
cardWidth
+
padding
)),
...
...
@@ -239,7 +244,9 @@ const CardSlider = (function(){
}
}
this
.
lastFrom
=
from
;
if
(
from
!==
lastFrom
){
this
.
lastFrom
=
from
;
}
this
.
lastTo
=
to
;
this
.
last
=
true
;
this
.
updateButtonsState
();
...
...
src/view/cmp/paginationSlider/PaginationSlider.jsx
View file @
2c622f30
...
...
@@ -13,6 +13,8 @@ const PaginationSliderSingleton = function(){
});
let
Slider
=
new
CardSlider
(
{
setOuterHeight
:
true
,
name
:
"standardSlider"
,
tpl
:
StandardCard
,
preset
:
{
...
...
src/view/page/account/Account.jsx
View file @
2c622f30
...
...
@@ -40,7 +40,6 @@ const Account = D.declare('view.page.Account', () => {
);
let
Slider
=
new
CardSlider
(
{
tpl
:
function
(
item
,
itemClick
,
n
)
{
return
<
div
className=
"card-slider__item"
>
<
Card
...
...
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