Skip to content

Commit

Permalink
fix(bitrix): Fix Bitrix iframes
Browse files Browse the repository at this point in the history
Closes #1883
  • Loading branch information
Phenome committed May 12, 2021
1 parent 216d0be commit 55c03be
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/scripts/content/bitrix24.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
'use strict';
/* global togglbutton, $ */

const addButton = ($container, iframeSelector) => {
const link = togglbutton.createTimerLink({
className: 'bitrix24',
description: descriptionSelector,
projectName: projectSelector,
tags: tagsSelector
}, iframeSelector);

$container.appendChild(link);
};

togglbutton.render(
'.task-detail .task-view-buttonset:not(.toggl)',
{ observe: true },
$container => {
const link = togglbutton.createTimerLink({
className: 'bitrix24',
description: descriptionSelector,
projectName: projectSelector,
tags: tagsSelector
});
addButton
);

$container.appendChild(link);
}
togglbutton.render(
'.task-detail .task-view-buttonset:not(.toggl)',
{
observe: true,
iframeSelector: 'iframe.side-panel-iframe:not(.toggl)'
},
$container => addButton($container, 'iframe.side-panel-iframe')
);

function descriptionSelector () {
Expand Down

0 comments on commit 55c03be

Please sign in to comment.