From 9e5e886fc8da48f36bbf79476c9580cda45d6ab0 Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Mon, 23 May 2022 12:29:33 +0100 Subject: [PATCH] issue/2799 Removed redundant behaviour (#224) --- README.md | 2 +- bower.json | 2 +- js/NarrativeView.js | 8 +++++--- js/adapt-contrib-narrative.js | 4 ++-- package.json | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 39a4ed7..7856597 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ The attributes listed below are used in *components.json* to configure **Narrati >>**attribution** (string): Optional text to be displayed as an [attribution](https://wiki.creativecommons.org/Best_practices_for_attribution). By default it is displayed below the image. Adjust positioning by modifying CSS. Text can contain HTML tags, e.g., `Copyright © 2015 by Lukasz 'Severiaan' Grela`. ->**strapline** (string): This text is displayed as a title above the image when `Adapt.device.screenSize` is `small` (i.e., when viewed on mobile devices). +>**strapline** (string): This text is displayed as a title above the image when `device.screenSize` is `small` (i.e., when viewed on mobile devices). ### Accessibility **Narrative** has been assigned a label using the [aria-label](https://github.com/adaptlearning/adapt_framework/wiki/Aria-Labels) attribute: **ariaRegion**. This label is not a visible element. It is utilized by assistive technology such as screen readers. Should the region's text need to be customised, it can be found within the **globals** object in [*properties.schema*](https://github.com/adaptlearning/adapt-contrib-narrative/blob/master/properties.schema). diff --git a/bower.json b/bower.json index b8373f8..afb3e72 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "adapt-contrib-narrative", "version": "6.5.4", - "framework": ">=5.17.2", + "framework": ">=5.19.1", "homepage": "https://github.com/adaptlearning/adapt-contrib-narrative", "bugs": "https://github.com/adaptlearning/adapt-contrib-narrative/issues", "component" : "narrative", diff --git a/js/NarrativeView.js b/js/NarrativeView.js index b381a6c..63626c3 100644 --- a/js/NarrativeView.js +++ b/js/NarrativeView.js @@ -1,7 +1,9 @@ import Adapt from 'core/js/adapt'; +import components from 'core/js/components'; import a11y from 'core/js/a11y'; -import ComponentView from 'core/js/views/componentView'; import device from 'core/js/device'; +import notify from 'core/js/notify'; +import ComponentView from 'core/js/views/componentView'; import MODE from './modeEnum'; class NarrativeView extends ComponentView { @@ -175,7 +177,7 @@ class NarrativeView extends ComponentView { } replaceWithHotgraphic() { - const HotgraphicView = Adapt.getViewClass('hotgraphic'); + const HotgraphicView = components.getViewClass('hotgraphic'); if (!HotgraphicView) return; const model = this.prepareHotgraphicModel(); @@ -294,7 +296,7 @@ class NarrativeView extends ComponentView { openPopup() { const currentItem = this.model.getActiveItem(); - Adapt.notify.popup({ + notify.popup({ title: currentItem.get('title'), body: currentItem.get('body') }); diff --git a/js/adapt-contrib-narrative.js b/js/adapt-contrib-narrative.js index f130692..2dfcdfc 100644 --- a/js/adapt-contrib-narrative.js +++ b/js/adapt-contrib-narrative.js @@ -1,8 +1,8 @@ -import Adapt from 'core/js/adapt'; +import components from 'core/js/components'; import NarrativeModel from './NarrativeModel'; import NarrativeView from './NarrativeView'; -export default Adapt.register('narrative', { +export default components.register('narrative', { model: NarrativeModel, view: NarrativeView }); diff --git a/package.json b/package.json index b8373f8..afb3e72 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "adapt-contrib-narrative", "version": "6.5.4", - "framework": ">=5.17.2", + "framework": ">=5.19.1", "homepage": "https://github.com/adaptlearning/adapt-contrib-narrative", "bugs": "https://github.com/adaptlearning/adapt-contrib-narrative/issues", "component" : "narrative",