Skip to content

Instantly share code, notes, and snippets.

@OnkelTem
Created July 31, 2014 21:15
Show Gist options
  • Save OnkelTem/18acd9ee9156055ed652 to your computer and use it in GitHub Desktop.
Save OnkelTem/18acd9ee9156055ed652 to your computer and use it in GitHub Desktop.
<div x-ng-repeat="item in data[key]" x-sd-toggle-fold class="item">
<div>
<div x-ng-bind-html="item.field_fc_info.teaser || item.field_fc_info.full | unsafe" class="left"></div>
<div x-ng-bind-html="item.body.teaser || item.body.full | unsafe" class="center"></div>
<div ng-if="item.body.teaser" class="right"><a href="#" class="toggle">Unfold</a></div>
</div>
<div ng-if="item.body.teaser" style="display: none">
<div x-ng-bind-html="item.field_fc_info.full || item.field_fc_info.teaser | unsafe" class="left"></div>
<div x-ng-bind-html="item.body.full || item.body.teaser | unsafe" class="center"></div>
<div class="right"><a href="#" class="toggle">Fold</a></div>
</div>
</div>
directive('sdToggleFold', ['$timeout', function ($timeout) {
return function(scope, element, attrs) {
$timeout(function() {
console.log('-', element.children().eq(0).find('.toggle'));
})
};
}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment