Refactor darker-background directive, extract method

This commit is contained in:
Luis Ramos
2020-05-02 20:07:50 +01:00
parent 0d6d071db2
commit d4980893a1

View File

@@ -1,4 +1,7 @@
Darkswarm.directive "darkerBackground", ->
restrict: "A"
link: (scope, elm, attr)->
elm.closest('.page-view').toggleClass("with-darker-background", true)
toggleClass = (value) ->
elm.closest('.page-view').toggleClass("with-darker-background", value)
toggleClass(true)