diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index bffc6e2d5..50e532204 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -371,11 +371,11 @@ define([ common.getAttribute(['general', 'share'], function (err, val) { val = val || {}; if (val.edit === false) { - $(link).find('#cp-share-editable-false').attr('checked', true); + $(link).find('#cp-share-editable-false').prop('checked', true); } - else { $(link).find('#cp-share-editable-true').attr('checked', true); } - if (val.embed) { $(link).find('#cp-share-embed').attr('checked', true); } - if (val.present) { $(link).find('#cp-share-present').attr('checked', true); } + else { $(link).find('#cp-share-editable-true').prop('checked', true); } + if (val.embed) { $(link).find('#cp-share-embed').prop('checked', true); } + if (val.present) { $(link).find('#cp-share-present').prop('checked', true); } $(link).find('#cp-share-link-preview').val(getLinkValue(val)); }); common.getMetadataMgr().onChange(function () { diff --git a/www/common/common-util.js b/www/common/common-util.js index c16a2cdfd..a67ba6673 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -249,8 +249,16 @@ define([], function () { Util.isChecked = function (el) { // could be nothing... if (!el) { return false; } - // jquery or dom elements should both be fine with this - return Boolean($(el).prop('checked')); + // check if it's a dom element + if (typeof(el.tagName) !== 'undefined') { + return Boolean(el.checked); + } + // sketchy test to see if it's jquery + if (typeof(el.prop) === 'function') { + return Boolean(el.prop('checked')); + } + // else just say it's not checked + return false; }; return Util;