Skip to content

Commit

Permalink
Merge pull request #123 from kaltura/KMS-11965_fix_bse_in_popup_for_ie
Browse files Browse the repository at this point in the history
KMS-11965 fix bse in popup for ie
  • Loading branch information
muli authored Jul 7, 2016
2 parents 1f02502 + 02a3fb9 commit 2e0d71e
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,27 @@ Y.extend(LTIPANEL, Y.Base, {
}

document.body.bsePopup = bsePopup;
var entrySelectedEvent = new Event('entrySelected');
document.body.myEvent = entrySelectedEvent;
var entrySelectedEvent = this.createEntrySelectedEvent();
document.body.entrySelectedEvent = entrySelectedEvent;
document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false);
},

createEntrySelectedEvent: function() {
var entrySelectedEvent;
if(typeof window.CustomEvent === 'function') {
entrySelectedEvent = new CustomEvent('entrySelected');
}
else {
// ie >= 9
entrySelectedEvent = document.createEvent('CustomEvent');
entrySelectedEvent.initCustomEvent('entrySelected', false, false, {});
}

return entrySelectedEvent;
},



/**
* Event handler callback for when a simulated click event is triggered on a specifc element.
*/
Expand Down Expand Up @@ -197,9 +213,23 @@ Y.extend(LTIPANELMEDIAASSIGNMENT, Y.Base, {
}

document.body.bsePopup = bsePopup;
var entrySelectedEvent = new Event('entrySelected');
document.body.myEvent = entrySelectedEvent;
document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this));
var entrySelectedEvent = this.createEntrySelectedEvent();
document.body.entrySelectedEvent = entrySelectedEvent;
document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false);
},

createEntrySelectedEvent: function() {
var entrySelectedEvent;
if(typeof window.CustomEvent === 'function') {
entrySelectedEvent = new CustomEvent('entrySelected');
}
else {
// ie >= 9
entrySelectedEvent = document.createEvent('CustomEvent');
entrySelectedEvent.initCustomEvent('entrySelected', false, false, {});
}

return entrySelectedEvent;
},

close_popup_callback: function() {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,27 @@ Y.extend(LTIPANEL, Y.Base, {
}

document.body.bsePopup = bsePopup;
var entrySelectedEvent = new Event('entrySelected');
document.body.myEvent = entrySelectedEvent;
var entrySelectedEvent = this.createEntrySelectedEvent();
document.body.entrySelectedEvent = entrySelectedEvent;
document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false);
},

createEntrySelectedEvent: function() {
var entrySelectedEvent;
if(typeof window.CustomEvent === 'function') {
entrySelectedEvent = new CustomEvent('entrySelected');
}
else {
// ie >= 9
entrySelectedEvent = document.createEvent('CustomEvent');
entrySelectedEvent.initCustomEvent('entrySelected', false, false, {});
}

return entrySelectedEvent;
},



/**
* Event handler callback for when a simulated click event is triggered on a specifc element.
*/
Expand Down Expand Up @@ -197,9 +213,23 @@ Y.extend(LTIPANELMEDIAASSIGNMENT, Y.Base, {
}

document.body.bsePopup = bsePopup;
var entrySelectedEvent = new Event('entrySelected');
document.body.myEvent = entrySelectedEvent;
document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this));
var entrySelectedEvent = this.createEntrySelectedEvent();
document.body.entrySelectedEvent = entrySelectedEvent;
document.body.addEventListener('entrySelected', this.close_popup_callback.bind(this), false);
},

createEntrySelectedEvent: function() {
var entrySelectedEvent;
if(typeof window.CustomEvent === 'function') {
entrySelectedEvent = new CustomEvent('entrySelected');
}
else {
// ie >= 9
entrySelectedEvent = document.createEvent('CustomEvent');
entrySelectedEvent.initCustomEvent('entrySelected', false, false, {});
}

return entrySelectedEvent;
},

close_popup_callback: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Y.extend(LTISERVICE, Y.Base, {
Y.one(documentElement.getElementById('closeltipanel')).simulate('click');
}

documentElement.body.dispatchEvent(documentElement.body.myEvent);
documentElement.body.dispatchEvent(documentElement.body.entrySelectedEvent);
}
},
{
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Y.extend(LTISERVICE, Y.Base, {
Y.one(documentElement.getElementById('closeltipanel')).simulate('click');
}

documentElement.body.dispatchEvent(documentElement.body.myEvent);
documentElement.body.dispatchEvent(documentElement.body.entrySelectedEvent);
}
},
{
Expand Down
Loading

0 comments on commit 2e0d71e

Please sign in to comment.