MDL-64175 atto_media: update advanced settings

Some OS, such as Ubuntu, are slightly changing the audio attributes,
from <audio attribute1="true"> to <audio attribute1>.
This patch is for reviewing this piece of code and covering both cases.
This commit is contained in:
Sara Arjona 2020-05-28 13:58:12 +02:00
parent 68fd8d8bdf
commit 2b860436c9
4 changed files with 11 additions and 5 deletions

View File

@ -714,7 +714,9 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
*/
_getMediumProperties: function(medium) {
var boolAttr = function(elem, attr) {
return elem.getAttribute(attr) ? true : false;
// As explained in MDL-64175, some OS (like Ubuntu), are removing the value for these attributes.
// So in order to check if attr="true", we need to check if the attribute exists and if the value is empty or true.
return (elem.hasAttribute(attr) && (elem.getAttribute(attr) || elem.getAttribute(attr) === ''));
};
var tracks = {

File diff suppressed because one or more lines are too long

View File

@ -714,7 +714,9 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
*/
_getMediumProperties: function(medium) {
var boolAttr = function(elem, attr) {
return elem.getAttribute(attr) ? true : false;
// As explained in MDL-64175, some OS (like Ubuntu), are removing the value for these attributes.
// So in order to check if attr="true", we need to check if the attribute exists and if the value is empty or true.
return (elem.hasAttribute(attr) && (elem.getAttribute(attr) || elem.getAttribute(attr) === ''));
};
var tracks = {

View File

@ -712,7 +712,9 @@ Y.namespace('M.atto_media').Button = Y.Base.create('button', Y.M.editor_atto.Edi
*/
_getMediumProperties: function(medium) {
var boolAttr = function(elem, attr) {
return elem.getAttribute(attr) ? true : false;
// As explained in MDL-64175, some OS (like Ubuntu), are removing the value for these attributes.
// So in order to check if attr="true", we need to check if the attribute exists and if the value is empty or true.
return (elem.hasAttribute(attr) && (elem.getAttribute(attr) || elem.getAttribute(attr) === ''));
};
var tracks = {