mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 07:52:10 +00:00
23 lines
No EOL
592 B
CoffeeScript
23 lines
No EOL
592 B
CoffeeScript
define [
|
|
"base"
|
|
], (App) ->
|
|
App.directive "fileEntity", ["RecursionHelper", (RecursionHelper) ->
|
|
return {
|
|
restrict: "E"
|
|
scope: {
|
|
entity: "="
|
|
permissions: "="
|
|
}
|
|
templateUrl: "entityListItemTemplate"
|
|
compile: (element) ->
|
|
RecursionHelper.compile element, (scope, element, attrs, ctrl) ->
|
|
# Don't freak out if we're already in an apply callback
|
|
scope.$originalApply = scope.$apply
|
|
scope.$apply = (fn = () ->) ->
|
|
phase = @$root.$$phase
|
|
if (phase == '$apply' || phase == '$digest')
|
|
fn()
|
|
else
|
|
@$originalApply(fn);
|
|
}
|
|
] |