Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11984

Weinre resources inspector bug in FF 49.0.1

    XMLWordPrintableJSON

Details

    Description

      When a developer tries to analyze the resoures of an app, the inspector fails to open the resources tree as in the image example:


      http://imgur.com/PjlMj8R

      The error message is the following:

      ReferenceError: event is not defined

      On the return statement of isEventWithinDisclosureTriangle in ResourcesPanel.js (line 833, col 9):

      ResourcesPanel.js
      isEventWithinDisclosureTriangle: function()
          {
              // Override it since we use margin-left in place of treeoutline's text-indent.
              // Hence we need to take padding into consideration. This all is needed for leading
              // icons in the tree.
              var paddingLeft = 14;
              var left = this.listItemElement.totalOffsetLeft + paddingLeft;
              return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth && this.hasChildren;
          }
      

      To fix this I just added event as an argument for that function. So now, the code is the following:

      ResourcesPanel.js
      isEventWithinDisclosureTriangle: function(event)
          {
              // Override it since we use margin-left in place of treeoutline's text-indent.
              // Hence we need to take padding into consideration. This all is needed for leading
              // icons in the tree.
              var paddingLeft = 14;
              var left = this.listItemElement.totalOffsetLeft + paddingLeft;
              return event.pageX >= left && event.pageX <= left + this.arrowToggleWidth && this.hasChildren;
          }
      

      And now it works!


      http://imgur.com/0DHS0OK

      Attachments

        Activity

          People

            Unassigned Unassigned
            pazitos10 Bruno Pazos
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified