Skip to content

Commit

Permalink
Add ability to set position "absolute" property for AlanButton
Browse files Browse the repository at this point in the history
  • Loading branch information
annmirosh committed Oct 23, 2020
1 parent 2b10b81 commit 6803ba4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions dist/alan_lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,10 @@ function alanBtn(options) {
mode = 'component';
}

if (options.position === 'absolute') {
pinned = true;
}

// Btn states
var DEFAULT = 'default';
var LISTENING = 'listening';
Expand Down Expand Up @@ -867,11 +871,11 @@ function alanBtn(options) {
rootEl.style.bottom = bottomBtnPos;
}

rootEl.style.position = isTutorMode() ? 'absolute' : 'fixed';
if (options.zIndex !== undefined) {
rootEl.style.zIndex = options.zIndex;
}
rootEl.style.position = isTutorMode() ? 'absolute' : 'fixed';

rootEl.style.position = options.position ? options.position : 'fixed';

// Define styles for block with recognised text
var textHolderDefaultBorderColor = '#d5eded';
Expand Down
2 changes: 1 addition & 1 deletion dist/alan_lib.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alan-ai/alan-sdk-web",
"version": "1.4.1",
"version": "1.5.0",
"description": "Alan Web SDK: a lightweight JavaScript library for adding a voice experience to your website or web application",
"keywords": [
"alan sdk web",
Expand Down

0 comments on commit 6803ba4

Please sign in to comment.