Skip to content

Commit

Permalink
Fixes #31
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertPeek committed Nov 12, 2021
1 parent 28f4340 commit b85e52a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ The Background selector attribute group contains values for **_isEnabled**, **_h
No known limitations.

----------------------------
**Version number:** 3.0.0
**Version number:** 3.0.1
**Framework versions supported:** 5+
**Author / maintainer:** DeltaNet with [contributors](https://github.com/deltanet/adapt-background-selector/graphs/contributors)
**Accessibility support:** Yes
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapt-background-selector",
"version": "3.0.0",
"version": "3.0.1",
"framework": ">=5",
"homepage": "https://github.com/deltanet/adapt-background-selector",
"issues": "https://github.com/deltanet/adapt-background-selector/issues",
Expand Down
10 changes: 4 additions & 6 deletions js/background-selector-videoView.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ define([
'remove': this.remove,
'popup:opened': this.popupOpened,
'popup:closed': this.popupClosed,
'pageView:ready': this.pageReady,
'device:changed': this.deviceChanged
});
},
Expand All @@ -39,17 +38,15 @@ define([
this.audioPromptIsOpen = false;
this.videoIsInView = false;

$(this.modelID).on('onscreen', this.onscreen.bind(this));

this.deviceChanged();

_.delay(function() {
this.popupOpened();
}.bind(this), 500);
},

pageReady: function () {
$(this.modelID).on('onscreen', this.onscreen.bind(this));
},

popupOpened: function() {
if ($('body').children('.audio-prompt').css('visibility') == 'visible') {
this.playVideo(false);
Expand Down Expand Up @@ -95,7 +92,8 @@ define([
onscreen: function(event, measurements) {
var visible = this.model.get('_isVisible');
var isOnscreenX = measurements.percentInviewHorizontal == 100;
var isOnscreenY = measurements.percentFromTop > 30 && measurements.percentFromTop < 101;
var isOnscreenY = (measurements.percentFromTop < 50) && (measurements.percentFromTop > -10);


if (visible && isOnscreenX && isOnscreenY) {
if (!this.notifyIsOpen && !this.audioPromptIsOpen) {
Expand Down

0 comments on commit b85e52a

Please sign in to comment.