Skip to content

Commit

Permalink
added autoSelectRange option
Browse files Browse the repository at this point in the history
  • Loading branch information
edsilv committed Mar 19, 2018
1 parent cce9a77 commit 27b1d6a
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dist/iiif-av-component.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/iiif-av-component.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ declare namespace IIIFComponents {
interface IAVComponentData {
[key: string]: any;
autoPlay?: boolean;
autoSelectRange?: boolean;
canvasId?: string;
constrainNavigationToRange?: boolean;
content?: IAVComponentContent;
Expand Down
4 changes: 3 additions & 1 deletion dist/iiif-av-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,9 @@ var IIIFComponents;
};
CanvasInstance.prototype._lowPriorityUpdater = function () {
this._updateMediaActiveStates();
this._hasRangeChanged();
if (this._data.autoSelectRange) {
this._hasRangeChanged();
}
};
CanvasInstance.prototype._updateMediaActiveStates = function () {
var contentAnnotation;
Expand Down
4 changes: 2 additions & 2 deletions dist/iiif-av-component.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ <h3 class="title"></h3>

avcomponent.set({
helper: helper,
autoSelectRange: false,
constrainNavigationToRange: true
});

Expand Down
4 changes: 3 additions & 1 deletion examples/js/iiif-av-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,9 @@ var IIIFComponents;
};
CanvasInstance.prototype._lowPriorityUpdater = function () {
this._updateMediaActiveStates();
this._hasRangeChanged();
if (this._data.autoSelectRange) {
this._hasRangeChanged();
}
};
CanvasInstance.prototype._updateMediaActiveStates = function () {
var contentAnnotation;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iiif-av-component",
"version": "0.0.29",
"version": "0.0.30",
"description": "",
"main": "index.js",
"types": "./dist/iiif-av-component.d.ts",
Expand Down
6 changes: 5 additions & 1 deletion src/CanvasInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,11 @@ namespace IIIFComponents {

private _lowPriorityUpdater(): void {
this._updateMediaActiveStates();
this._hasRangeChanged();

if (this._data.autoSelectRange) {
this._hasRangeChanged();
}

}

private _updateMediaActiveStates(): void {
Expand Down
1 change: 1 addition & 0 deletions src/IAVComponentData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace IIIFComponents {
export interface IAVComponentData {
[key: string]: any;
autoPlay?: boolean;
autoSelectRange?: boolean;
canvasId?: string;
constrainNavigationToRange?: boolean;
content?: IAVComponentContent;
Expand Down

0 comments on commit 27b1d6a

Please sign in to comment.