Skip to content

Commit

Permalink
Merge pull request #124 from kaltura/KMS-11965_fix_bse_in_popup_for_i…
Browse files Browse the repository at this point in the history
…e_moodle_29

KMS-11965 fix bse in popup for ie moodle 29
  • Loading branch information
muli authored Jul 7, 2016
2 parents 694bb04 + 755f861 commit fe6af43
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 fe6af43

Please sign in to comment.