move function into directive
Merge branch 'master' of https://github.com/sharewave/frontus