Antonio-Maranhao commented on a change in pull request #948: Fix sidebar 
expand/collapse when design doc name has special chars
URL: https://github.com/apache/couchdb-fauxton/pull/948#discussion_r131926184
 
 

 ##########
 File path: app/helpers.js
 ##########
 @@ -57,4 +57,13 @@ Helpers.getDateFromNow = function (timestamp) {
   return moment(timestamp, 'X').fromNow();
 };
 
+/**
+ * Escapes any characters that have special meaning in JQuery selectors.
+ * @param {string} selector
+ * @return {string}
+ */
+Helpers.escapeJQuerySelector = function (selector) {
 
 Review comment:
   It handles CSS metachars and escapes them with `\` instead of `%`.
   The doc ID is used as ID for some `<div>`. When the ID has chars like `#` or 
`.`,  JQuery fails because it considers those metachars. E.g. if you want to 
find element with ID `#foo.bar` your query would be `$('#\#foo\.bar')`
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to