Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-4235

JS error when trying to filter the sitemap tree.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.4.2, 3.5
    • 3.5
    • Plugin : Web
    • None

      In fact it works only in Firefox.

      In chrome console : Uncaught TypeError: Object index has no method 'startsWith'

      Javascript does not define startsWith (as well endsWith and contains), but Firefox implements it MDN ref
      ECMAScript Harmony (ES6, still in development) has only made a proposal for those methods.

      Best workaround I am aware of is :

       
      if (typeof String.prototype.startsWith != 'function') {
        String.prototype.startsWith = function (str){
          return this.lastIndexOf(str, 0) === 0
        };
      }
      

            cedric CĂ©dric Damioli
            trizzi Thibaut Rizzi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: