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 17:27:16 +02:00
parent 35dd608161
commit 3a76c07806
4 changed files with 10 additions and 4 deletions
@@ -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
@@ -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 = {
+3 -1
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 = {