Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
F
facets
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
6
Merge Requests
6
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
facets
Commits
9868f953
Commit
9868f953
authored
May 24, 2017
by
borisson_
Committed by
borisson_
May 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2872090
by borisson_: Update javascript coding standards
parent
c8e1d683
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
18 deletions
+34
-18
js/checkbox-widget.js
js/checkbox-widget.js
+9
-3
js/dropdown-widget.js
js/dropdown-widget.js
+5
-0
js/edit-facet.js
js/edit-facet.js
+2
-2
js/index-active-formatters.js
js/index-active-formatters.js
+1
-1
js/soft-limit.js
js/soft-limit.js
+8
-3
modules/facets_range_widget/js/slider.js
modules/facets_range_widget/js/slider.js
+9
-9
No files found.
js/checkbox-widget.js
View file @
9868f953
...
...
@@ -5,7 +5,7 @@
(
function
(
$
)
{
"
use strict
"
;
'
use strict
'
;
Drupal
.
facets
=
Drupal
.
facets
||
{};
Drupal
.
behaviors
.
facetsCheckboxWidget
=
{
...
...
@@ -22,7 +22,7 @@
var
$links
=
$
(
'
.js-facets-checkbox-links .facet-item a
'
);
$links
.
once
(
'
facets-checkbox-transform
'
).
each
(
Drupal
.
facets
.
makeCheckbox
);
// Set indeterminate value on parents having an active trail.
$
(
'
.facet-item--expanded.facet-item--active-trail > input
'
).
prop
(
"
indeterminate
"
,
true
);
$
(
'
.facet-item--expanded.facet-item--active-trail > input
'
).
prop
(
'
indeterminate
'
,
true
);
};
/**
...
...
@@ -57,6 +57,9 @@
/**
* Disable all facet checkboxes in the facet and apply a 'disabled' class.
*
* @param {object} $facet
* jQuery object of the facet.
*/
Drupal
.
facets
.
disableFacet
=
function
(
$facet
)
{
$facet
.
addClass
(
'
facets-disabled
'
);
...
...
@@ -66,9 +69,12 @@
/**
* Event listener for easy prevention of event propagation.
*
* @param {object} e
* Event.
*/
Drupal
.
facets
.
preventDefault
=
function
(
e
)
{
e
.
preventDefault
();
}
}
;
})(
jQuery
);
js/dropdown-widget.js
View file @
9868f953
...
...
@@ -16,6 +16,11 @@
/**
* Turns all facet links into a dropdown with options for every link.
*
* @param {object} context
* Context.
* @param {object} settings
* Settings.
*/
Drupal
.
facets
.
makeDropdown
=
function
(
context
,
settings
)
{
// Find all dropdown facet links and turn them into an option.
...
...
js/edit-facet.js
View file @
9868f953
...
...
@@ -5,7 +5,7 @@
(
function
(
$
)
{
"
use strict
"
;
'
use strict
'
;
Drupal
.
behaviors
.
facetsEditForm
=
{
attach
:
function
(
context
,
settings
)
{
...
...
@@ -16,7 +16,7 @@
$
(
'
#edit-name
'
).
val
(
default_name
);
setTimeout
(
function
()
{
$
(
'
#edit-name
'
).
trigger
(
'
change
'
);
},
100
);
})
})
;
}
};
...
...
js/index-active-formatters.js
View file @
9868f953
...
...
@@ -5,7 +5,7 @@
(
function
(
$
)
{
"
use strict
"
;
'
use strict
'
;
Drupal
.
behaviors
.
facetsIndexFormatter
=
{
attach
:
function
(
context
,
settings
)
{
...
...
js/soft-limit.js
View file @
9868f953
...
...
@@ -5,14 +5,14 @@
(
function
(
$
)
{
"
use strict
"
;
'
use strict
'
;
Drupal
.
behaviors
.
facetSoftLimit
=
{
attach
:
function
(
context
,
settings
)
{
if
(
settings
.
facets
.
softLimit
!=
undefined
)
{
if
(
settings
.
facets
.
softLimit
!=
=
undefined
)
{
$
.
each
(
settings
.
facets
.
softLimit
,
function
(
facet
,
limit
)
{
Drupal
.
facets
.
applySoftLimit
(
facet
,
limit
);
})
})
;
}
}
};
...
...
@@ -21,6 +21,11 @@
/**
* Applies the soft limit UI feature to a specific facets list.
*
* @param {string} facet
* The facet id.
* @param {string} limit
* The maximum amount of items to show.
*/
Drupal
.
facets
.
applySoftLimit
=
function
(
facet
,
limit
)
{
var
zero_based_limit
=
limit
-
1
;
...
...
modules/facets_range_widget/js/slider.js
View file @
9868f953
...
...
@@ -4,23 +4,23 @@
*/
(
function
(
$
)
{
"
use strict
"
;
'
use strict
'
;
Drupal
.
facets
=
Drupal
.
facets
||
{};
Drupal
.
behaviors
.
facet_slider
=
{
attach
:
function
(
context
,
settings
)
{
if
(
settings
.
facets
!=
undefined
&&
settings
.
facets
.
sliders
!
=
undefined
)
{
if
(
settings
.
facets
!=
=
undefined
&&
settings
.
facets
.
sliders
!=
=
undefined
)
{
$
.
each
(
settings
.
facets
.
sliders
,
function
(
facet
,
settings
)
{
Drupal
.
facets
.
addSlider
(
facet
,
settings
);
})
})
;
}
}
};
Drupal
.
facets
.
addSlider
=
function
(
facet
,
settings
)
{
var
defaults
=
{
stop
:
function
(
event
,
ui
)
{
stop
:
function
(
event
,
ui
)
{
if
(
settings
.
range
)
{
window
.
location
.
href
=
settings
.
url
.
replace
(
'
__range_slider_min__
'
,
ui
.
values
[
0
]).
replace
(
'
__range_slider_max__
'
,
ui
.
values
[
1
]);
}
...
...
@@ -32,16 +32,16 @@
$
.
extend
(
defaults
,
settings
);
$
(
"
#
"
+
facet
).
slider
(
defaults
)
.
slider
(
"
pips
"
,
{
$
(
'
#
'
+
facet
).
slider
(
defaults
)
.
slider
(
'
pips
'
,
{
prefix
:
settings
.
prefix
,
suffix
:
settings
.
suffix
})
.
slider
(
"
float
"
,
{
.
slider
(
'
float
'
,
{
prefix
:
settings
.
prefix
,
suffix
:
settings
.
suffix
,
labels
:
settings
.
labels
})
}
})
;
}
;
})(
jQuery
);
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