Will close install Temasys plugin popup only when cancel or close button is clicked.

This commit is contained in:
paweldomas 2015-09-07 10:16:56 +02:00
parent f69e7ace6d
commit b9b64242a5
1 changed files with 11 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/*! adapterjs - custom version from - 2015-08-19 */ /*! adapterjs - v0.12.0 - 2015-09-04 */
// Adapter's interface. // Adapter's interface.
var AdapterJS = AdapterJS || {}; var AdapterJS = AdapterJS || {};
@ -331,9 +331,10 @@ AdapterJS.renderNotificationBar = function (text, buttonText, buttonLink, openNe
'sans-serif; font-size: .9rem; padding: 4px; vertical-align: ' + 'sans-serif; font-size: .9rem; padding: 4px; vertical-align: ' +
'middle; cursor: default;">' + text + '</span>'); 'middle; cursor: default;">' + text + '</span>');
if(buttonText && buttonLink) { if(buttonText && buttonLink) {
c.document.write('<button id="okay">' + buttonText + '</button><button>Cancel</button>'); c.document.write('<button id="okay">' + buttonText + '</button><button id="cancel">Cancel</button>');
c.document.close(); c.document.close();
// On click on okay
AdapterJS.addEvent(c.document.getElementById('okay'), 'click', function(e) { AdapterJS.addEvent(c.document.getElementById('okay'), 'click', function(e) {
if (!!displayRefreshBar) { if (!!displayRefreshBar) {
AdapterJS.renderNotificationBar(AdapterJS.TEXT.EXTENSION ? AdapterJS.renderNotificationBar(AdapterJS.TEXT.EXTENSION ?
@ -363,12 +364,14 @@ AdapterJS.renderNotificationBar = function (text, buttonText, buttonLink, openNe
}); });
} , 500); } , 500);
}); });
// On click on Cancel
AdapterJS.addEvent(c.document.getElementById('cancel'), 'click', function(e) {
w.document.body.removeChild(i);
});
} else { } else {
c.document.close(); c.document.close();
} }
AdapterJS.addEvent(c.document, 'click', function() {
w.document.body.removeChild(i);
});
setTimeout(function() { setTimeout(function() {
if(typeof i.style.webkitTransform === 'string') { if(typeof i.style.webkitTransform === 'string') {
i.style.webkitTransform = 'translateY(40px)'; i.style.webkitTransform = 'translateY(40px)';
@ -743,7 +746,7 @@ if (navigator.mozGetUserMedia) {
// the minimum version still supported by adapter. // the minimum version still supported by adapter.
webrtcMinimumVersion = 12; webrtcMinimumVersion = 12;
getUserMedia = navigator.getUserMedia; window.getUserMedia = navigator.getUserMedia.bind(navigator);
attachMediaStream = function(element, stream) { attachMediaStream = function(element, stream) {
element.srcObject = stream; element.srcObject = stream;
@ -1072,9 +1075,11 @@ if (navigator.mozGetUserMedia) {
} }
var newElement = document.getElementById(elementId); var newElement = document.getElementById(elementId);
newElement.onplaying = (element.onplaying) ? element.onplaying : function (arg) {}; newElement.onplaying = (element.onplaying) ? element.onplaying : function (arg) {};
newElement.onplay = (element.onplay) ? element.onplay : function (arg) {};
newElement.onclick = (element.onclick) ? element.onclick : function (arg) {}; newElement.onclick = (element.onclick) ? element.onclick : function (arg) {};
if (isIE) { // on IE the event needs to be plugged manually if (isIE) { // on IE the event needs to be plugged manually
newElement.attachEvent('onplaying', newElement.onplaying); newElement.attachEvent('onplaying', newElement.onplaying);
newElement.attachEvent('onplay', newElement.onplay);
newElement._TemOnClick = function (id) { newElement._TemOnClick = function (id) {
var arg = { var arg = {
srcElement : document.getElementById(id) srcElement : document.getElementById(id)