Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/materialize-css/js/cards.js')
-rw-r--r--node_modules/materialize-css/js/cards.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/node_modules/materialize-css/js/cards.js b/node_modules/materialize-css/js/cards.js
new file mode 100644
index 0000000000..0c1ad737a1
--- /dev/null
+++ b/node_modules/materialize-css/js/cards.js
@@ -0,0 +1,40 @@
+(function($, anim) {
+ $(document).on('click', '.card', function(e) {
+ if ($(this).children('.card-reveal').length) {
+ var $card = $(e.target).closest('.card');
+ if ($card.data('initialOverflow') === undefined) {
+ $card.data(
+ 'initialOverflow',
+ $card.css('overflow') === undefined ? '' : $card.css('overflow')
+ );
+ }
+ let $cardReveal = $(this).find('.card-reveal');
+ if (
+ $(e.target).is($('.card-reveal .card-title')) ||
+ $(e.target).is($('.card-reveal .card-title i'))
+ ) {
+ // Make Reveal animate down and display none
+ anim({
+ targets: $cardReveal[0],
+ translateY: 0,
+ duration: 225,
+ easing: 'easeInOutQuad',
+ complete: function(anim) {
+ let el = anim.animatables[0].target;
+ $(el).css({ display: 'none' });
+ $card.css('overflow', $card.data('initialOverflow'));
+ }
+ });
+ } else if ($(e.target).is($('.card .activator')) || $(e.target).is($('.card .activator i'))) {
+ $card.css('overflow', 'hidden');
+ $cardReveal.css({ display: 'block' });
+ anim({
+ targets: $cardReveal[0],
+ translateY: '-100%',
+ duration: 300,
+ easing: 'easeInOutQuad'
+ });
+ }
+ }
+ });
+})(cash, M.anime);