Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
cards
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Curtis Adam
cards
Commits
cbe6092b
Commit
cbe6092b
authored
Jun 25, 2019
by
Curtis Adam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show the filter dropdown if the user clicks on a label filter
parent
e44867cb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
9 deletions
+20
-9
imports/api/filterNavigation.js
imports/api/filterNavigation.js
+11
-0
imports/ui/filter/index/index.js
imports/ui/filter/index/index.js
+7
-0
imports/ui/main/main.js
imports/ui/main/main.js
+1
-1
imports/ui/main/navigation/top/item/filter.js
imports/ui/main/navigation/top/item/filter.js
+1
-8
No files found.
imports/api/filterNavigation.js
View file @
cbe6092b
...
...
@@ -3,8 +3,19 @@ import {Session} from "meteor/session";
import
{
Filter
}
from
"
./filter
"
;
import
*
as
config
from
"
../config/filter.js
"
;
import
{
NavigatorCheck
}
from
"
./navigatorCheck
"
;
import
{
MainNavigation
}
from
"
./mainNavigation
"
;
export
let
FilterNavigation
=
class
FilterNavigation
{
static
showDropdown
(
forceOn
=
true
)
{
if
(
$
(
'
.navbar-cards-filter-dropdown
'
).
hasClass
(
'
active
'
)
&&
!
forceOn
)
{
$
(
'
.navbar-cards-filter-dropdown
'
).
removeClass
(
'
active
'
);
}
else
{
$
(
'
.navbar-cards-filter-dropdown
'
).
addClass
(
'
active
'
);
FilterNavigation
.
setMaxDropdownHeight
();
MainNavigation
.
closeCollapse
();
}
}
static
gotAuthorFilter
(
filterType
)
{
return
config
.
filtersWithAuthor
.
includes
(
filterType
);
}
...
...
imports/ui/filter/index/index.js
View file @
cbe6092b
...
...
@@ -61,24 +61,31 @@ Session.set('moduleActive', true);
Template
.
filterIndex
.
events
({
'
click .label-wordcloud
'
:
function
()
{
Filter
.
setActiveFilter
(
true
,
"
wordcloud
"
);
FilterNavigation
.
showDropdown
();
},
'
click .label-lecturer-authorized
'
:
function
()
{
Filter
.
setActiveFilter
(
true
,
"
lecturerAuthorized
"
);
FilterNavigation
.
showDropdown
();
},
'
click .label-kind
'
:
function
(
event
)
{
Filter
.
setActiveFilter
([
$
(
event
.
target
).
data
(
'
id
'
)],
"
kind
"
);
FilterNavigation
.
showDropdown
();
},
'
click .label-card-type
'
:
function
(
event
)
{
Filter
.
setActiveFilter
(
Number
(
$
(
event
.
target
).
data
(
'
id
'
)),
"
cardType
"
);
FilterNavigation
.
showDropdown
();
},
'
click .label-difficulty
'
:
function
(
event
)
{
Filter
.
setActiveFilter
(
Number
(
$
(
event
.
target
).
data
(
'
id
'
)),
"
difficulty
"
);
FilterNavigation
.
showDropdown
();
},
'
click .label-bonus
'
:
function
()
{
Filter
.
setActiveFilter
(
true
,
"
bonusActive
"
);
FilterNavigation
.
showDropdown
();
},
'
click .label-transcript-bonus
'
:
function
()
{
Filter
.
setActiveFilter
(
true
,
"
transcriptBonus
"
);
FilterNavigation
.
showDropdown
();
}
});
...
...
imports/ui/main/main.js
View file @
cbe6092b
...
...
@@ -152,7 +152,7 @@ Template.main.onRendered(function () {
MainNavigation
.
clearSearch
();
$
(
'
.navbar-cards-search-dropdown
'
).
removeClass
(
'
active
'
);
}
if
(
!
$
(
event
.
target
).
is
(
'
.cards-filter-element
'
))
{
if
(
!
$
(
event
.
target
).
is
(
'
.cards-filter-element
'
)
&&
!
$
(
event
.
target
).
parents
(
'
.resultItemHeaderBottomAreaLabels
'
).
length
)
{
MainNavigation
.
clearSearch
();
$
(
'
.navbar-cards-filter-dropdown
'
).
removeClass
(
'
active
'
);
}
...
...
imports/ui/main/navigation/top/item/filter.js
View file @
cbe6092b
import
{
MainNavigation
}
from
"
../../../../../api/mainNavigation
"
;
import
{
FilterNavigation
}
from
"
../../../../../api/filterNavigation
"
;
import
{
Template
}
from
"
meteor/templating
"
;
import
"
./filter.html
"
;
...
...
@@ -12,13 +11,7 @@ import "./filter.html";
let
filterResizeSensor
;
Template
.
mainNavigationTopItemFilterDropdown
.
events
({
'
click .toggle-filter-dropdown
'
:
function
()
{
if
(
$
(
'
.navbar-cards-filter-dropdown
'
).
hasClass
(
'
active
'
))
{
$
(
'
.navbar-cards-filter-dropdown
'
).
removeClass
(
'
active
'
);
}
else
{
$
(
'
.navbar-cards-filter-dropdown
'
).
addClass
(
'
active
'
);
FilterNavigation
.
setMaxDropdownHeight
();
MainNavigation
.
closeCollapse
();
}
FilterNavigation
.
showDropdown
(
false
);
}
});
...
...
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