diff --git a/src/jstree.js b/src/jstree.js index 8f80ac5b..1df63f0a 100644 --- a/src/jstree.js +++ b/src/jstree.js @@ -84,7 +84,7 @@ idregex : /[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g, root : '#' }; - + /** * creates a jstree instance * @name $.jstree.create(el [, options]) @@ -454,7 +454,7 @@ */ restore_focus : true, /** - * Force to compute and set "aria-setsize" and "aria-posinset" explicitly for each treeitem. + * Force to compute and set "aria-setsize" and "aria-posinset" explicitly for each treeitem. * Some browsers may compute incorrect elements position and produce wrong announcements for screen readers. Defaults to `false` * @name $.jstree.defaults.core.compute_elements_positions */ @@ -2722,7 +2722,7 @@ if(!animation) { this.trigger('before_open', { "node" : obj }); d[0].className = d[0].className.replace('jstree-closed', 'jstree-open'); - d[0].childNodes[1].setAttribute("aria-expanded", true); + d.children('.jstree-anchor').attr("aria-expanded", true); } else { this.trigger('before_open', { "node" : obj }); @@ -4996,7 +4996,7 @@ return d; }; $.vakata.trim = function (text) { - return String.prototype.trim ? + return String.prototype.trim ? String.prototype.trim.call(text.toString()) : text.toString().replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); };