Merge pull request #12979 from cillian/remove-unused-angular-directives-2024-11

Remove unused renderSvg, ofnDisableScroll, integer, ofnScrollTo angular directives
This commit is contained in:
Konrad
2025-01-04 15:50:38 +01:00
committed by GitHub
7 changed files with 0 additions and 176 deletions

View File

@@ -1,10 +0,0 @@
angular.module('Darkswarm').directive "ofnDisableScroll", ()->
# Stops scrolling from incrementing or decrementing input value
# Useful for number inputs
restrict: 'A'
link: (scope, element, attrs)->
element.bind 'focus', ->
element.bind 'mousewheel', (e)->
e.preventDefault()
element.bind 'blur', ->
element.unbind 'mousewheel'

View File

@@ -1,5 +0,0 @@
angular.module('Darkswarm').directive "integer", ->
restrict: 'A'
link: (scope, elem, attr) ->
elem.bind 'input', ->
elem.val Math.round(elem.val())

View File

@@ -1,14 +0,0 @@
angular.module('Darkswarm').directive "renderSvg", ()->
# Magical directive that'll render SVGs from URLs
# If only there were a neater way of doing this
restrict: 'E'
priority: 99
template: "<svg-wrapper></svg-wrapper>"
# Fetch SVG via ajax, inject into page using DOM
link: (scope, elem, attr)->
if /.svg/.test attr.path # Only do this if we've got an svg
$.ajax
url: attr.path
success: (html)->
elem.html($(html).find("svg"))

View File

@@ -1,9 +0,0 @@
angular.module('Darkswarm').directive "ofnScrollTo", ($location, $anchorScroll)->
# Onclick sets $location.hash to attrs.ofnScrollTo
# Then triggers anchorScroll
restrict: 'A'
link: (scope, element, attrs)->
element.bind 'click', (ev)->
ev.stopPropagation()
$location.hash attrs.ofnScrollTo
$anchorScroll()

View File

@@ -64,14 +64,6 @@ products .filter-box {
li.active a {
color: $clr-brick;
render-svg {
svg {
path {
fill: $clr-brick;
}
}
}
&:hover, &:focus {
border-color: $clr-brick-bright;
}
@@ -102,43 +94,10 @@ products .filter-box {
&:hover, &:focus {
color: $clr-brick-bright;
render-svg {
svg {
path {
fill: $clr-brick-bright;
}
}
}
}
&:active, &.active {
color: $clr-brick;
render-svg {
svg {
path {
fill: $clr-brick;
}
}
}
}
render-svg {
display: block;
width: 1.5rem;
height: 1.5rem;
margin: 0 0.2rem 0 0;
padding: 0;
svg {
width: 1.5rem;
height: 1.5rem;
path {
fill: #666;
}
}
}
}
}

View File

@@ -35,32 +35,9 @@
padding-left: 0.25rem;
}
render-svg {
&, & svg {
width: 1rem;
height: 1rem;
float: left;
padding-right: 0.25rem;
path {
@include csstrans;
fill: $base-clr;
}
}
}
&:hover, &:focus {
border-color: $hover-clr;
color: $hover-clr;
render-svg {
svg {
path {
fill: $hover-clr;
}
}
}
}
&.disabled {
@@ -69,14 +46,6 @@
&:hover, &:focus {
border-color: $border-clr;
color: $base-clr;
render-svg {
svg {
path {
fill: $base-clr;
}
}
}
}
}
@@ -84,14 +53,6 @@
border: 1px solid $base-clr;
background: $base-clr;
color: white;
render-svg {
svg {
path {
fill: white;
}
}
}
}
}
}

View File

@@ -13,66 +13,8 @@
padding: 0.25rem 0.5rem 0.35rem 0.35rem;
render-svg {
svg {
width: 16px;
height: 16px;
path {
fill: #555;
}
}
}
&, & * {
display: inline-block;
color: #555;
}
}
.inactive {
.fat-taxons {
render-svg {}
svg {
path {
fill: $disabled-dark;
}
}
}
}
.product-header {
render-svg {
svg {
width: 32px;
height: 32px;
path {
fill: black;
}
}
}
@include breakpoint(phablet) {
render-svg {
svg {
width: 24px;
height: 24px;
}
}
}
}
.summary-header {
render-svg {
svg {
width: 18px;
height: 18px;
path {
fill: $clr-brick;
}
}
}
}