From 2c2f5e3b0e93fd33a2d69e71703bbb677cbebee9 Mon Sep 17 00:00:00 2001 From: Dan Gray Date: Fri, 31 Jul 2020 14:24:47 +0100 Subject: [PATCH 1/8] Update LESS, template and JS for FW v5 --- js/adapt-flipcard-audio.js | 16 ++++++++-------- less/flipcard-audio.less | 18 +++++++++--------- templates/flipcard-audio.hbs | 6 +++--- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/js/adapt-flipcard-audio.js b/js/adapt-flipcard-audio.js index 67cbf65..07f4593 100644 --- a/js/adapt-flipcard-audio.js +++ b/js/adapt-flipcard-audio.js @@ -1,7 +1,8 @@ define([ 'core/js/adapt', - 'core/js/views/componentView' -], function(Adapt, ComponentView) { + 'core/js/views/componentView', + 'core/js/models/componentModel' +], function(Adapt, ComponentView, ComponentModel) { var FlipcardAudio = ComponentView.extend({ @@ -204,7 +205,6 @@ define([ }, flipItem: function(index, active) { - var $item = this.$('.flipcard-audio-item').eq(index); var flipTime = this.model.get('_flipTime') || 'fast'; @@ -217,7 +217,6 @@ define([ // If item isn't flipped if (this.itemFlipped[index] == false && active) { - $item.addClass('flipcard-audio-flip'); this.itemFlipped[index] = true; @@ -232,7 +231,7 @@ define([ ///// End of Audio ///// this.setVisited(index); - $item.addClass("visited"); + $item.addClass("is-visited"); $backflipcard.a11y_cntrl_enabled(true); @@ -283,8 +282,9 @@ define([ }); - Adapt.register('flipcard-audio', FlipcardAudio); - - return FlipcardAudio; + return Adapt.register('flipcard-audio', { + model: ComponentModel.extend({}), + view: FlipcardAudio + }); }); diff --git a/less/flipcard-audio.less b/less/flipcard-audio.less index d2a1df9..4f47c8c 100644 --- a/less/flipcard-audio.less +++ b/less/flipcard-audio.less @@ -4,6 +4,7 @@ @flipcard-audio-item-rotate-Y-plus180deg: rotateY(180deg); @flipcard-audio-item-rotate-Y-0deg: rotateY(0deg); + .vendor-prefix (@property, @value) { -webkit-@{property}: @value; -moz-@{property}: @value; @@ -12,7 +13,7 @@ @{property}: @value; } -.flipcard-audio-component { +.flipcard-audio { .flipcard-audio-widget { position: relative; @@ -22,22 +23,22 @@ .flipcard-audio-listitem { position: relative; display: inline-block; - margin-top: @component-padding; + margin-top: @item-margin; } .flipcard-audio-item { vertical-align: top; margin-left: 1%; margin-right: 1%; - color: @primary-color-inverted; + color: @font-color-inverted; &:hover { - color: @primary-color-inverted; + color: @font-color-inverted; } - &.visited { + &.is-visited { .flipcard-audio-item-front { - border: 3px solid @item-color-visited; + border: 3px solid @visited; } } } @@ -107,12 +108,11 @@ } .flipcard-audio-item-back-title { - padding-bottom: @component-padding; - .sub-title; + padding-bottom: @item-padding; } .flipcard-audio-item-back-body { - font-weight: @body-text-font-weight; + font-weight: @font-weight-regular; } @media all and (max-width: @device-width-medium) { diff --git a/templates/flipcard-audio.hbs b/templates/flipcard-audio.hbs index 2663772..ad6e83a 100644 --- a/templates/flipcard-audio.hbs +++ b/templates/flipcard-audio.hbs @@ -1,10 +1,10 @@ -
+
{{> component this}} -
+
{{#each _items}}
-