only show edit button on close if editable

This commit is contained in:
rolux 2013-02-14 13:04:07 +05:30
parent d3e68f5ba0
commit d40f66978a

View file

@ -2,9 +2,11 @@ window.addEventListener('message', function(event) {
if (event.origin != 'null' && event.data) {
var data = JSON.parse(event.data);
if (data.event == 'close') {
var e = document.getElementById(data.id);
Array.prototype.forEach.call(e.parentElement.getElementsByClassName('button'), function(e) {
e.style.display = 'block';
var element = document.getElementById(data.id);
Array.prototype.forEach.call(element.parentElement.getElementsByClassName('button'), function(element) {
if (editable || element.className = 'button playButton') {
element.style.display = 'block';
}
});
e.parentElement.removeChild(e);
}