Skip to content

Commit

Permalink
Merge pull request #191 from joelthorner/2.x
Browse files Browse the repository at this point in the history
2.x
  • Loading branch information
joelthorner authored Sep 11, 2019
2 parents b4172ed + 595480b commit de27d34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 4 additions & 8 deletions js/inject/zendesk/ticket-consume.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,32 +76,28 @@ TicketConsume = {
chrome.runtime.onMessage.addListener(function (message, sender) {
try {
var data = JSON.parse(message.data);
log('TicketConsume intranet', 'success');
console.log(data);
log('TicketConsume intranet', 'success'); console.log(data);
$.extend(true,TicketConsume.data, data)

$(document).off('DOMSubtreeModified').on('DOMSubtreeModified', function (event) {
if ($(event.target).find('[href*="organizations"]').length) {
$('[data-test-id="customercontext-userinfo-organization"] [href*="organizations"]').each(function (index, ticketOrg) {
let $ticketOrg = $(ticketOrg);
if (typeof $ticketOrg.data('ovserved-org') === 'undefined') {

$ticketOrg.data('ovserved-org', true);
let findOrgId = $ticketOrg.attr('href').match(/\d{1,}/);

if (findOrgId) {
let orgId = findOrgId[0], orgName = $ticketOrg.text().trim().toLowerCase();

TicketConsume.observerInit(orgId, orgName, $ticketOrg);
}
}
})
});
TicketConsume.initIntervals();
}
});
} catch (error) {
log('TicketConsume invalid data', 'danger');
console.log(message.data);
log('TicketConsume invalid data', 'danger'); console.log(message.data);
}
});
},
Expand Down
3 changes: 2 additions & 1 deletion js/options/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const CHANGELOG = [
version: 'v2.3.15', date: '10 Sep 2019',
lines: [
'FIXED Fix multiple open windows by TicketConsume (Zendesk) #188',
'IMPROVED Gulp automatic version replace (dev) #189'
'IMPROVED Gulp automatic version replace (dev) #189',
'FIXED Fix "method_lines" issue in js/inject/zendesk/ticket-consume.js #186'
]
}, {
version: 'v2.3.14', date: '04 Sep 2019',
Expand Down

0 comments on commit de27d34

Please sign in to comment.