Skip to content

Commit

Permalink
Merge pull request #204 from redshark1802/bugfix/fixed-faulty-selector
Browse files Browse the repository at this point in the history
fixed faulty class selector
  • Loading branch information
LogansUA authored Sep 14, 2016
2 parents 0f6ac9d + bdc884a commit f84c8bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Resources/public/js/init.standard.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function initTinyMCE(options) {
if (_t) textareas.push(_t);
break;
case ".":
textareas = getElementsByClassName(options.selector.substring(1), 'textarea');
textareas = getElementsByClassName(options.selector, 'textarea');
break;
default :
textareas = document.getElementsByTagName('textarea');
Expand Down

1 comment on commit f84c8bc

@benr77
Copy link
Contributor

@benr77 benr77 commented on f84c8bc Oct 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just wrong. If the selector is ".tinymce" then the switch statement takes the first character, meaning the period is required, leaving the getElementsByClassName to take the rest of the selector string, minus the first character. So the .substring(1) is needed

Please sign in to comment.